Tag Info

Hot answers tagged


You can do that with two ways. 1. You can modify the WordPress main query to force WordPress to show posts older than 30 days on archive pages and on blog page, show posts before 30 days. You can limit posts with the help of date_query. Paste this function in your functions.php file. This should work. I have tested it briefly. function ...


Take a look at the "Template Hierarchy" Codex page. Custom Post Type Archive display Template file used to render the Archive Index page for a Custom Post Type. [emphasis added] By my reading, that means that the archive-{cpt_slug}.php template is only used for the page that, by default, lists all posts of that post type in reverse chronological ...


Because WordPress redirected to index.php when it should have loaded archive.php or archive-cpt.php I made a workaround like so: add_rewrite_rule( $cpt_name . '/page/?([0-9]{1,})?$', 'index.php?post_type=' . $cpt_slug . '&qpaged=$matches[1]', 'top' ); qpaged instead of paged.

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