Skip to content

Instantly share code, notes, and snippets.

@wpexplorer
Created April 28, 2015 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpexplorer/ed76bd8826bb33b698f0 to your computer and use it in GitHub Desktop.
Save wpexplorer/ed76bd8826bb33b698f0 to your computer and use it in GitHub Desktop.
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