Change Archive Post Number for Custom Post Type

Modify the number of WordPress posts or custom posts to be displayed on a custom archive page by adding this filter to your functions.php file in WordPress.

 

Change the number of “posts_per_page” to meet your specs, if you leave it at -1, it will show all the posts for this query.

To change it for category or tag archives…

 

Other conditional tags for archive pages
is_date() – When any date-based archive page is being displayed
is_year() – When a yearly archive is being displayed.
is_month() – When a monthly archive is being displayed.
is_day() – When a daily archive is being displayed.
is_time() – When an hourly, “minutely”, or “secondly” archive is being displayed.
is_search() – When a search result page archive is being displayed.
is_404() – When a page displays after an “HTTP 404: Not Found” error occurs.

  • Thanks much, I too had developed a code for the similar thing a while back, but mine wasn’t as clean as yours. I guess your mentioning of multiple conditional tags should be of great help to the novices.