Hello Steve,
Thanks for your reply. The theme is the Rockettheme base boilerplate if you will, Gantry5/hydrogen. I use it when building Joomla sites as well. They have a content array particle that will not allow pagination, I’ve gotten that from the theme devs, so now I need to rebuild it using the WordPress blog page.
I’m much newer to WP than Joomla so I may be mistaken about your question, but my theme’s archive.php file uses get_post_type() to pull in the blog posts.
I’ve posted the archive.php file:
<?php
/**
* @package Gantry 5 Theme
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 – 2016 RocketTheme, LLC
* @license GNU/GPLv2 and later
*
* http://www.gnu.org/licenses/gpl-2.0.html
*/
defined(‘ABSPATH’) or die;
/*
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*/
$gantry = Gantry\Framework\Gantry::instance();
$theme = $gantry[‘theme’];
// We need to render contents of <head> before plugin content gets added.
$context = Timber::get_context();
$context[‘page_head’] = $theme->render(‘partials/page_head.html.twig’, $context);
$templates = [‘archive.html.twig’, ‘index.html.twig’];
$context[‘title’] = __(‘Archive’, ‘g5_hydrogen’);
if (is_day()) {
$context[‘title’] = __(‘Archive:’, ‘g5_hydrogen’) . ‘ ‘ . get_the_date(‘j F Y’);
} else if (is_month()) {
$context[‘title’] = __(‘Archive:’, ‘g5_hydrogen’) . ‘ ‘ . get_the_date(‘F Y’);
} else if (is_year()) {
$context[‘title’] = __(‘Archive:’, ‘g5_hydrogen’) . ‘ ‘ . get_the_date(‘Y’);
} else if (is_tag()) {
$context[‘title’] = single_tag_title(”, false);
} else if (is_category()) {
$context[‘title’] = single_cat_title(”, false);
array_unshift($templates, ‘archive-‘ . get_query_var(‘cat’) . ‘.html.twig’);
} else if (is_post_type_archive()) {
$context[‘title’] = post_type_archive_title(”, false);
array_unshift($templates, ‘archive-‘ . get_post_type() . ‘.html.twig’);
}
$context[‘posts’] = Timber::get_posts();
Timber::render($templates, $context);