Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function category_homepage( $query ) {
- global $wp_the_query;
- if ( $query->is_home() && $query == $wp_the_query ) {
- $query->set( 'tax_query', array( array(
- 'taxonomy' => 'category',
- 'terms' => 'homepage',
- 'field' => 'slug'
- ) ) );
- }
- }
- add_action( 'pre_get_posts', 'category_homepage' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement