Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function arts_is_blog_page() {
- global $post;
- // Post type must be 'post'.
- $post_type = get_post_type( $post );
- // Check all blog-related conditional tags, as well as the current post type,
- // to determine if we're viewing a blog page.
- return (
- ( is_home() || is_archive() || is_single() )
- && ( $post_type == 'post' )
- ) ? true : false;
- }
- add_filter( 'body_class', 'arts_add_no_ajax_blog_classes' );
- function arts_add_no_ajax_blog_classes( $classes ) {
- $body_classes = array( 'page-no-ajax', 'no-ajax' );
- if ( arts_is_blog_page() ) {
- $classes = array_merge( $classes, $body_classes );
- }
- return $classes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement