WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making a custom post type that I want to use in the form of a plugin - all pretty straight forward.

However, I want the archive page for this post type to look slightly different in the content area - how would I achieve this without having to ask the end user to move files to their template directory?

I hope that makes sense, if not please ask me to clarify further - I've not really been able to find anything in the codex, but maybe I'm looking in the wrong place.

share|improve this question
up vote 1 down vote accepted

Use archive_template filter in your plugin to override archive templates for a given post type, for example, movies:

function get_movies_archive_template( $archive_template ) {
     global $post;
     if ( is_post_type_archive ( 'movies' ) ) {
          $archive_template = dirname( __FILE__ ) . '/templates/movies-archive-template.php';
     return $archive_template;
add_filter( 'archive_template', 'get_movies_archive_template' ) ;

See archive_template in Codex.

share|improve this answer
Looks like what I need - thanks! so I would make a custom file with a structure like get header - my custom content - get footer? – user319940 Mar 15 '13 at 11:38
Yes, that's right. It have to be the regular WP template. – Max Yudin Mar 15 '13 at 11:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.