Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Add this function in the functions.php file */
- function wpmidia_custom_post_types_archives($query) {
- $post_types = array('post','custom1','custom2','custom3');
- if ( ! is_archive() && ! in_array( get_post_type(), $post_types ) )
- return $query;
- $query->set( 'post_type', $post_types );
- return $query;
- }
- add_filter('pre_get_posts', 'wpmidia_custom_post_types_archives');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement