Tag Info

Hot answers tagged

2

Drop your custom query and go back to the default loop. Never replace the main query on the home page or any kind of archive page with a custom query. Use pre_get_posts to alter the main query variables before the main query runs Your taxonomy archive page should look like this if ( have_posts() ) { while ( have_posts() ) { the_post(); ...


2

If I understand you correctly you just want to display a different amount of posts at archives, for this you don't need a custom secondary query at all. You can control it via pre_get_posts hook, either making use of posts_per_page or posts_per_archive_page parameter. Example for pre_get_posts function wpse188786_different_number_of_posts_for_archive_ppp( ...


1

Are you sure that you don't have a page with the same name of the custom post type? If you do, the permalink rewrite rules will get confused and trigger a 404. A very simple solution is: The page that lists the custom post types is called in plural (eg. products) and the actual post type name is in singular (eg. product). So they don't conflict and it's ...



Only top voted, non community-wiki answers of a minimum length are eligible