1 2 3 4 5 6 7 |
/* allow show products for author*/ add_action('pre_get_posts', 'my_pre_get_posts'); function my_pre_get_posts($query) { if ($query->is_author() && $query->is_main_query()) { $query->set('post_type', 'product'); } } |