• 0
Sign in to follow this  
Followers 0

Custom Post Types in Features

Question

Posted · Report post

How can I put Custom Post Types in Features and in Carousel? Why when I put the code below in functions.php, the Features section disappear?

add_filter( 'pre_get_posts', 'my_get_posts' );
	
	function my_get_posts( $query ) {
	
		if ( is_home() && false == $query->query_vars['suppress_filters'] )
			$query->set( 'post_type', array( 'post', 'post1', 'post2', 'post3' ) );
	
		return $query;
		wp_reset_query();
	}

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Posted · Report post

Did he say anything more about the "suppress_filters" problem (whether it needs to be set as true or false)? I'm not familiar with suppress_filters but I did some searching around, and it's explained a bit here: http://jspr.tndy.me/custom-ordering-of-wordpress-posts/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0