changing post type in loop query
To have the first code block to work on a secondary query, you’d need: function customize_customtaxonomy_query ( $query ) { $query->set(‘post_type’, array(‘business’) ); // return $query; // not necessary; actions do not return anything } add_action( ‘pre_get_posts’, ‘customize_customtaxonomy_query’ ); $q = new WP_Query($args); And you should remove it afterwards so that it doesn’t interfere with … Read more