Multiple Post Types
-
I am trying to run a query to select multiple post types. I have a post type called update-history and would like to select it and the post post type.
I’ve tried to achieve this a few different ways and can not figure it out, if at all possible. I do have in my functions.php file a filter for pre_get_posts:
add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( ( is_home() && $query->is_main_query() ) || is_feed() ) $query->set( 'post_type', array( 'post', 'update-history' ) ); return $query; }
but this filter does not seem to be respected by this plugin. Any advice or updates would be helpful.
- The topic ‘Multiple Post Types’ is closed to new replies.