Private: Home › Forums › WordPress Themes › Elvyre – Retina Ready WordPress Theme › Filter category for one page › Reply To: Filter category for one page
December 17, 2014 at 3:16 pm
#1330
Participant
Hello,
Unfortunately, there is no option to filter by category in blog page in Elvyre theme.
You can do this by modifying functions.php file. Add the following code to it:
function my_home_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '123' );
}
}
add_action( 'pre_get_posts', 'my_home_category' );
Just change ‘123’ to the desired category id from which all the posts should be displayed.
Also, we advise you to create an Elvyre child theme for all the modifications.
Robert