Home › Support Forums › Theme Support › Second portfolio? › Reply To: Second portfolio?
Hi and thanks again for the guidance!
I tested some stuff around and ended up modifying the pinboard_filter_query in functions.php (I’m using a Child Theme by the way).
Basically, I added a line, so now it reads the following:
if ( ! function_exists( ‘pinboard_filter_query’ ) ) :
/**
* Filter the main loop
*
* Allows overriding of query parameters
* for the main loop without performing
* additional database queries
*
* @since Pinboard 1.0
*/
function pinboard_filter_query( $query ) {
global $wp_the_query;
if( $wp_the_query === $query ) {
if( $query->is_home() && pinboard_get_option( ‘slider’ ) )
$query->set( ‘ignore_sticky_posts’, 1 );
if( $query->is_home() && pinboard_get_option( ‘blog_exclude_portfolio’ ) )
$query->set( ‘cat’, ‘-‘ . pinboard_get_option( ‘portfolio_cat’ ) );
if( $query->is_home() )
$query->set( ‘cat’, ‘-25, -22, -18’ );
}
}
endif;
I have no idea if this is good code, whether I am altering other functions of the theme or not, but it works – which is my goal. But just in case, so that if I ever encounter an issue, do you by any chance know if this is having impacts on other things? I suspect my added line from neutralising the portfolio exclusion function (while I was testing, I had to manually remove the portfolio category, otherwise it would display again while the one I was trying to take off wouldn’t show up).