Forums

Custom tag archive page for custom post type (2 posts)

  1. jlheidecker
    Member
    Posted 4 months ago #

    I have a custom post type called "client." I have an archive-client.php page that works beautifully. This page also has a tag-cloud of all the tags used for the client post type. Unfortunately, when I click a tag link to "/tag/whatever-tag-this-is", I get sent to the generic archive page.

    This makes sense according to this flow chart:
    http://codex.wordpress.org/Template_Hierarchy

    My interpretation of that flow chart is that it is not possible to create a "tag-client.php".

    Is this correct? no way to create a tag archive page for a specific custom post type? only custom tag archives for specific tags?

    So I'm required to use some conditional statements within archive.php or tag.php based on post type?

  2. deepbevel
    Member
    Posted 4 months ago #

    Yes, a conditional statement, something like this should do:

    if ( get_post_type() == 'client' ){
    	include (TEMPLATEPATH.'/your-custom-archive-template.php');
    	return;
    }

Reply

You must log in to post.

About this Topic

Tags

No tags yet.