Created
April 28, 2015 02:00
-
-
Save wpexplorer/ed76bd8826bb33b698f0 to your computer and use it in GitHub Desktop.
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
if ( ! function_exists( 'wpex_page_slider' ) ) { | |
function wpex_page_slider() { | |
// Get post ID | |
if ( function_exists( 'is_shop' ) && function_exists( 'wc_get_page_id' ) && is_shop() ) { | |
$post_id = wc_get_page_id( 'shop' ); | |
} else { | |
$post_id = get_the_ID(); | |
} | |
// Get slider | |
$slider = get_post_meta( $post_id, 'wpex_page_slider_shortcode', true ); | |
// Check if page title is enabled | |
$main_title = get_post_meta( $post_id, 'wpex_disable_title', true ); | |
// Return if slider isn't defined | |
if ( ! $slider ) return; ?> | |
<div class="page-slider clr page-title-disable-<?php echo $main_title; ?>"> | |
<?php echo apply_filters( 'the_content', $slider ); ?> | |
</div><!-- .page-slider --> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment