-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from FameThemes/development
Merge brand development to master
- Loading branch information
Showing
9 changed files
with
101 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,126 @@ | ||
<?php | ||
$id = get_theme_mod( 'onepress_hero_id', esc_html__('hero', 'onepress') ); | ||
$disable = sanitize_text_field( get_theme_mod( 'onepress_hero_disable' ) ) == 1 ? true : false ; | ||
$id = get_theme_mod( 'onepress_hero_id', esc_html__( 'hero', 'onepress' ) ); | ||
$disable = sanitize_text_field( get_theme_mod( 'onepress_hero_disable' ) ) == 1 ? true : false; | ||
$fullscreen = sanitize_text_field( get_theme_mod( 'onepress_hero_fullscreen' ) ); | ||
$pdtop = floatval( get_theme_mod( 'onepress_hero_pdtop', '10' ) ); | ||
$pdbottom = floatval( get_theme_mod( 'onepress_hero_pdbotom', '10' ) ); | ||
|
||
if ( onepress_is_selective_refresh() ) { | ||
$disable = false; | ||
$disable = false; | ||
} | ||
|
||
$hero_content_style = ''; | ||
if ( $fullscreen != '1' ) { | ||
$hero_content_style = ' style="padding-top: '. $pdtop .'%; padding-bottom: '. $pdbottom .'%;"'; | ||
$hero_content_style = ' style="padding-top: ' . $pdtop . '%; padding-bottom: ' . $pdbottom . '%;"'; | ||
} | ||
|
||
$_images = get_theme_mod('onepress_hero_images'); | ||
if (is_string($_images)) { | ||
$_images = json_decode($_images, true); | ||
$_images = get_theme_mod( 'onepress_hero_images' ); | ||
if ( is_string( $_images ) ) { | ||
$_images = json_decode( $_images, true ); | ||
} | ||
|
||
if ( empty( $_images ) || !is_array( $_images ) ) { | ||
$_images = array(); | ||
if ( empty( $_images ) || ! is_array( $_images ) ) { | ||
$_images = array(); | ||
} | ||
|
||
$images = array(); | ||
|
||
foreach ( $_images as $m ) { | ||
$m = wp_parse_args( $m, array('image' => '' ) ); | ||
$m = wp_parse_args( $m, array( 'image' => '' ) ); | ||
$_u = onepress_get_media_url( $m['image'] ); | ||
if ( $_u ) { | ||
$images[] = $_u; | ||
} | ||
} | ||
|
||
if ( empty( $images ) ){ | ||
$images = array( get_template_directory_uri().'/assets/images/hero5.jpg' ); | ||
if ( empty( $images ) ) { | ||
$images = array( get_template_directory_uri() . '/assets/images/hero5.jpg' ); | ||
} | ||
|
||
$is_parallax = get_theme_mod( 'onepress_hero_parallax' ) == 1 && ! empty( $images ) ; | ||
$is_parallax = get_theme_mod( 'onepress_hero_parallax' ) == 1 && ! empty( $images ); | ||
$hook_args = array(); | ||
if ( $is_parallax ) { | ||
$hook_args = array( | ||
'image' => $images[0], | ||
'alpha' => '', | ||
'enable_parallax' => 1, | ||
'_bg_type' => 'image' | ||
); | ||
$hook_args = array( | ||
'image' => $images[0], | ||
'alpha' => '', | ||
'enable_parallax' => 1, | ||
'_bg_type' => 'image', | ||
); | ||
} | ||
|
||
do_action('onepress_before_section_part', 'hero', $hook_args ); | ||
do_action( 'onepress_before_section_part', 'hero', $hook_args ); | ||
|
||
?> | ||
<?php if ( ! $disable && ! empty ( $images ) ) : ?> | ||
<section id="<?php if ( $id != '' ){ echo esc_attr( $id ); } ?>" <?php if ( ! empty ( $images) && ! $is_parallax ) { ?> data-images="<?php echo esc_attr( json_encode( $images ) ); ?>"<?php } ?> | ||
class="hero-slideshow-wrapper <?php echo ( $fullscreen == 1 ) ? 'hero-slideshow-fullscreen' : 'hero-slideshow-normal'; ?>"> | ||
|
||
<?php if ( ! get_theme_mod( 'onepress_hero_disable_preload', false ) ) { ?> | ||
<div class="slider-spinner"> | ||
<div class="double-bounce1"></div> | ||
<div class="double-bounce2"></div> | ||
</div> | ||
<?php } ?> | ||
|
||
<?php | ||
<?php if ( ! $disable && ! empty( $images ) ) : ?> | ||
<section id="<?php if ( $id != '' ) { | ||
echo esc_attr( $id ); } ?>" <?php if ( ! empty( $images ) && ! $is_parallax ) { | ||
?> data-images="<?php echo esc_attr( json_encode( $images ) ); ?>"<?php } ?> | ||
class="hero-slideshow-wrapper <?php echo ( $fullscreen == 1 ) ? 'hero-slideshow-fullscreen' : 'hero-slideshow-normal'; ?>"> | ||
|
||
<?php if ( ! get_theme_mod( 'onepress_hero_disable_preload', false ) ) { ?> | ||
<div class="slider-spinner"> | ||
<div class="double-bounce1"></div> | ||
<div class="double-bounce2"></div> | ||
</div> | ||
<?php } ?> | ||
|
||
<?php | ||
$layout = get_theme_mod( 'onepress_hero_layout', 1 ); | ||
switch( $layout ) { | ||
switch ( $layout ) { | ||
case 2: | ||
$hcl2_content = get_theme_mod( 'onepress_hcl2_content', wp_kses_post( '<h1>Business Website'."\n".'Made Simple.</h1>'."\n".'We provide creative solutions to clients around the world,'."\n".'creating things that get attention and meaningful.'."\n\n".'<a class="btn btn-secondary-outline btn-lg" href="#">Get Started</a>' ) ); | ||
$hcl2_image = get_theme_mod( 'onepress_hcl2_image', get_template_directory_uri().'/assets/images/onepress_responsive.png' ); | ||
$hcl2_content = get_theme_mod( 'onepress_hcl2_content', wp_kses_post( '<h1>Business Website' . "\n" . 'Made Simple.</h1>' . "\n" . 'We provide creative solutions to clients around the world,' . "\n" . 'creating things that get attention and meaningful.' . "\n\n" . '<a class="btn btn-secondary-outline btn-lg" href="#">Get Started</a>' ) ); | ||
$hcl2_image = get_theme_mod( 'onepress_hcl2_image', get_template_directory_uri() . '/assets/images/onepress_responsive.png' ); | ||
?> | ||
<div class="container"<?php echo $hero_content_style; ?>> | ||
<div class="row hero__content hero-content-style<?php echo esc_attr( $layout ); ?>"> | ||
<div class="col-md-12 col-lg-6"> | ||
<?php if ( $hcl2_content ) { echo '<div class="hcl2-content">'.apply_filters( 'the_content', do_shortcode( wp_kses_post( $hcl2_content ) ) ).'</div>' ; }; ?> | ||
<?php if ( $hcl2_content ) { | ||
echo '<div class="hcl2-content">' . apply_filters( 'the_content', do_shortcode( wp_kses_post( $hcl2_content ) ) ) . '</div>'; | ||
}; ?> | ||
</div> | ||
<div class="col-md-12 col-lg-6"> | ||
<?php if ( $hcl2_image ) { echo '<img class="hcl2-image" src="'.esc_url( $hcl2_image ).'" alt="">' ; }; ?> | ||
<?php if ( $hcl2_image ) { | ||
echo '<img class="hcl2-image" src="' . esc_url( $hcl2_image ) . '" alt="">'; | ||
}; ?> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
break; | ||
break; | ||
default: | ||
$hcl1_largetext = get_theme_mod( 'onepress_hcl1_largetext', wp_kses_post('We are <span class="js-rotating">OnePress | One Page | Responsive | Perfection</span>', 'onepress' )); | ||
$hcl1_smalltext = get_theme_mod( 'onepress_hcl1_smalltext', wp_kses_post('Morbi tempus porta nunc <strong>pharetra quisque</strong> ligula imperdiet posuere<br> vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'onepress') ); | ||
$hcl1_btn1_text = get_theme_mod( 'onepress_hcl1_btn1_text', esc_html__('Our Services', 'onepress') ); | ||
$hcl1_btn1_link = get_theme_mod( 'onepress_hcl1_btn1_link', esc_url( home_url( '/' )).esc_html__('#services', 'onepress') ); | ||
$hcl1_btn2_text = get_theme_mod( 'onepress_hcl1_btn2_text', esc_html__('Get Started', 'onepress') ); | ||
$hcl1_btn2_link = get_theme_mod( 'onepress_hcl1_btn2_link', esc_url( home_url( '/' )).esc_html__('#contact', 'onepress') ); | ||
$hcl1_largetext = get_theme_mod( 'onepress_hcl1_largetext', wp_kses_post( 'We are <span class="js-rotating">OnePress | One Page | Responsive | Perfection</span>', 'onepress' ) ); | ||
$hcl1_smalltext = get_theme_mod( 'onepress_hcl1_smalltext', wp_kses_post( 'Morbi tempus porta nunc <strong>pharetra quisque</strong> ligula imperdiet posuere<br> vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'onepress' ) ); | ||
$hcl1_btn1_text = get_theme_mod( 'onepress_hcl1_btn1_text', esc_html__( 'Our Services', 'onepress' ) ); | ||
$hcl1_btn1_link = get_theme_mod( 'onepress_hcl1_btn1_link', esc_url( home_url( '/' ) ) . esc_html__( '#services', 'onepress' ) ); | ||
$hcl1_btn2_text = get_theme_mod( 'onepress_hcl1_btn2_text', esc_html__( 'Get Started', 'onepress' ) ); | ||
$hcl1_btn2_link = get_theme_mod( 'onepress_hcl1_btn2_link', esc_url( home_url( '/' ) ) . esc_html__( '#contact', 'onepress' ) ); | ||
|
||
$btn_1_style = get_theme_mod( 'onepress_hcl1_btn1_style', 'btn-theme-primary' ); | ||
$btn_2_style = get_theme_mod( 'onepress_hcl1_btn2_style', 'btn-secondary-outline' ); | ||
$btn_1_style = get_theme_mod( 'onepress_hcl1_btn1_style', 'btn-theme-primary' ); | ||
$btn_2_style = get_theme_mod( 'onepress_hcl1_btn2_style', 'btn-secondary-outline' ); | ||
|
||
$btn_1_target = get_theme_mod( 'onepress_hcl1_btn1_target' ); | ||
$btn_1_target = get_theme_mod( 'onepress_hcl1_btn1_target' ); | ||
$btn_2_target = get_theme_mod( 'onepress_hcl1_btn2_target' ); | ||
$target_1 = ( $btn_1_target == 1 ) ? 'target="_blank"' : ''; | ||
$target_2 = ( $btn_2_target == 1 ) ? 'target="_blank"' : ''; | ||
|
||
?> | ||
<div class="container"<?php echo $hero_content_style; ?>> | ||
<div class="hero__content hero-content-style<?php echo esc_attr( $layout ); ?>"> | ||
<?php if ($hcl1_largetext != '') echo '<h2 class="hero-large-text">' . wp_kses_post($hcl1_largetext) . '</h2>'; ?> | ||
<?php if ($hcl1_smalltext != '') echo '<p class="hero-small-text"> ' . do_shortcode( wp_kses_post( $hcl1_smalltext ) ) . '</p>' ?> | ||
<?php if ($hcl1_btn1_text != '' && $hcl1_btn1_link != '') echo '<a '. $target_1 .' href="' . esc_url($hcl1_btn1_link) . '" class="btn '.esc_attr( $btn_1_style ).' btn-lg">' . wp_kses_post($hcl1_btn1_text) . '</a>'; ?> | ||
<?php if ($hcl1_btn2_text != '' && $hcl1_btn2_link != '') echo '<a '. $target_2 .' href="' . esc_url($hcl1_btn2_link) . '" class="btn '.esc_attr( $btn_2_style ).' btn-lg">' . wp_kses_post($hcl1_btn2_text) . '</a>'; ?> | ||
<?php if ( $hcl1_largetext != '' ) { | ||
echo '<h2 class="hero-large-text">' . wp_kses_post( $hcl1_largetext ) . '</h2>';} ?> | ||
<?php if ( $hcl1_smalltext != '' ) { | ||
echo '<p class="hero-small-text">' . apply_filters( 'onepress_the_content', wp_kses_post( $hcl1_smalltext ) ) . '</p>';} ?> | ||
<?php if ( $hcl1_btn1_text != '' && $hcl1_btn1_link != '' ) { | ||
echo '<a ' . $target_1 . ' href="' . esc_url( $hcl1_btn1_link ) . '" class="btn ' . esc_attr( $btn_1_style ) . ' btn-lg">' . wp_kses_post( $hcl1_btn1_text ) . '</a>';} ?> | ||
<?php if ( $hcl1_btn2_text != '' && $hcl1_btn2_link != '' ) { | ||
echo '<a ' . $target_2 . ' href="' . esc_url( $hcl1_btn2_link ) . '" class="btn ' . esc_attr( $btn_2_style ) . ' btn-lg">' . wp_kses_post( $hcl1_btn2_text ) . '</a>';} ?> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
|
||
?> | ||
?> | ||
</section> | ||
<?php endif; | ||
|
||
do_action('onepress_after_section_part', 'hero', $hook_args ); | ||
do_action( 'onepress_after_section_part', 'hero', $hook_args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters