Skip to content

Instantly share code, notes, and snippets.

Created March 28, 2017 06:26
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 anonymous/4fc720b9e63d56d0ee41a76635c3ff40 to your computer and use it in GitHub Desktop.
Save anonymous/4fc720b9e63d56d0ee41a76635c3ff40 to your computer and use it in GitHub Desktop.
function education_hub_check_slider_status( $input ){
global $post, $wp_query;
// Slider status
$featured_slider_status = education_hub_get_option( 'featured_slider_status' );
// Get Page ID outside Loop
$page_id = $wp_query->get_queried_object_id();
// Front page displays in Reading Settings
$page_on_front = get_option( 'page_on_front' ) ;
$page_for_posts = get_option( 'page_for_posts' );
if ( 'entire-site' == $featured_slider_status || ( ( is_front_page() || ( !is_home() && $page_for_posts === $page_id ) ) && 'home-page' === $featured_slider_status ) ){
$input = true;
}
else{
$input = false;
}
return $input;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment