Title: Archive does not use archive.php template
Last modified: March 27, 2018

---

# Archive does not use archive.php template

 *  Resolved [Trialstyle](https://wordpress.org/support/users/trialstyle/)
 * (@trialstyle)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/archive-does-not-use-archive-php-template/)
 * Hello,
    I have wordpress with Primer Theme installed. I wanted to change the 
   look of my archive and had to add some divs and some classes. To do so I tried
   to change the archive.php. Nothing happened so I installed the Reveal Template
   plugin to see which template is used for my current archive. This said that index.
   php is used. I want it to use archive.php (and i thought this is first choice?!).
   Does primer change something in there? How can I fix that? My Blog page is not
   my front page. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Evan Herman](https://wordpress.org/support/users/eherman24/)
 * (@eherman24)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/archive-does-not-use-archive-php-template/#post-10119803)
 * Hi [@trialstyle](https://wordpress.org/support/users/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](https://developer.wordpress.org/themes/basics/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](https://developer.wordpress.org/reference/hooks/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 );
       ```
   
 *  Thread Starter [Trialstyle](https://wordpress.org/support/users/trialstyle/)
 * (@trialstyle)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/archive-does-not-use-archive-php-template/#post-10119872)
 * Thanks, helped a lot! Created the home.php template now in my child theme.
 *  [Evan Herman](https://wordpress.org/support/users/eherman24/)
 * (@eherman24)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/archive-does-not-use-archive-php-template/#post-10120163)
 * Awesome – not a problem at all. Glad I could help point you in the right direction.
   Have a great week!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Archive does not use archive.php template’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/primer/1.8.10/screenshot.png)
 * Primer
 * [Support Threads](https://wordpress.org/support/theme/primer/)
 * [Active Topics](https://wordpress.org/support/theme/primer/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/primer/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/primer/reviews/)

## Tags

 * [index](https://wordpress.org/support/topic-tag/index/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 3 replies
 * 2 participants
 * Last reply from: [Evan Herman](https://wordpress.org/support/users/eherman24/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/archive-does-not-use-archive-php-template/#post-10120163)
 * Status: resolved