Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('pre_get_posts', 'query_post_type');
- function query_post_type($query) {
- if ( is_archive() && empty( $query->query_vars['suppress_filters'] ) ) {
- $post_type = get_query_var('post_type');
- $post_types = get_post_types();
- if($post_type)
- $post_type = $post_type;
- else
- $post_type = $post_types;
- $query->set('post_type',$post_type);
- return $query;
- }
- }
- add_filter('widget_posts_args', 'wpsites_modify_recent_posts_widget');
- function wpsites_modify_recent_posts_widget($params) {
- $params['post_type'] = array('post', '$post_type');
- return $params;
- }
Add Comment
Please, Sign In to add comment