I’ve built a custom archive page within WordPress
using Timber
and the Route method. The page works well and shows a combination of Custom Post Types
but the feed at {url}/feed doesn’t exist.
note: Previous answer has been edited to remove confusing side issues.
// create CPT (x 3)
register_post_type($name, array(
'label' => 'custom1',
'public' => true,
'capability_type' => 'page',
'supports' => array( 'title', 'author', 'excerpt', 'revisions', 'thumbnail'),
'taxonomies' => array('post_tag'),
'has_archive' => true
));
// CPT route
Routes::map('test/filter/:filter', function($params){
$query = array(
'post_type' => array('custom1', 'custom2', 'custom3' )
);
$filter = $params;
Routes::load('archive.php', $filter, $query, 200);
});
// paging CPT route
Routes::map('test/filter/:filter/page/:page', function($params){
$query = array(
'post_type' => array('custom1', 'custom2', 'custom3' ),
'paged' => intval($params['page'])
);
$filter = $params;
Routes::load('archive.php', $filter, $query, 200);
});
@sidonaldson: Ahhhh now I realize what you’re looking for! Yes, this happens at the WP level, not Timber
Previous answer….
@sidonaldson â this is an untested answer, but here’s what to give a shot to:
query_posts
is basically the WordPress equivalent of a sledge hammer that will affect RSS, pagination and everything else. Here’s what should work…