functions.php
/**
 * Adjust is_home query if vogue-blog-cats is set
 */
Adjust is_home query if vogue-blog-cats is set
Adjust is_home query if vogue - blog - cats is set
function vogue_set_blog_queries( $query ) {
    $blog_query_set = '';
    if ( get_theme_mod( 'vogue-blog-cats', false ) ) {
        $blog_query_set = get_theme_mod( 'vogue-blog-cats' );
    }
    if ( $blog_query_set ) {
        if ( !is_admin() && $query->is_main_query() ){
            if ( is_home() ){
                $query->set( 'cat', $blog_query_set );
            }
        }
    }
}
function vogue_set_blog_queries ( $ query ) { $ blog_query_set = '' ; if ( get_theme_mod ( 'vogue-blog-cats' , false ) ) { $ blog_query_set = get_theme_mod ( 'vogue-blog-cats' ) ; } if ( $ blog_query_set ) { if ( ! is_admin ( ) && $ query -> is_main_query ( ) ) { if ( is_home ( ) ) { $ query -> set ( 'cat' , $ blog_query_set ) ; } } } }
Adjust is_home query if vogue-blog-cats is set
Adjust is_home query if vogue - blog - cats is set
// do not alter the query on wp-admin pages and only alter it if it's the main query