Hi @trialstyle,
When you say you want to change the look of your archive, are you referring to the blog listing page itself? The archive.php template is used for categories, tags, custom taxonomies, custom post types, authors and dates.
index.php is used for your blog page, not the home page. Whatever you have set on ‘Settings > Reading > Blog’ is what will reference index.php.
If you want to make changes to your blog page you’ll want to make a child theme of Primer and copy over the files out of the root directory or the appropriate template files from within the /templates/ directory of the parent Primer theme.
You can always reference the Template Hierarchy article for additional info.
Additionally, if you just want to add classes to the divs of the blog page, you can hook into the filter post_class and add the classes that way.
Example:
/**
* Add custom classes onto the blog post divs.
*
* @param array $classes An array of post classes.
* @param string $class An array of additional classes added to the post.
* @param int $post_id The post ID.
*
* @return array Filtered post classes array.
*/
function primer_custom_post_classes( $classes, $class, $post_id ) {
if ( ! is_home() ) {
return $classes;
}
$classes[] = 'custom-class';
return $classes;
}
add_filter( 'post_class', 'primer_custom_post_classes', 10, 3 );
Thanks, helped a lot! Created the home.php template now in my child theme.
Awesome – not a problem at all. Glad I could help point you in the right direction. Have a great week!