Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

here's another stumper.

I have a tag.php page. It works fine, unless you click a tag that is in a post associated with a custom post type. Then it doesn't work. Its like that tag, doesn't exist. But its just a tag that's used cross site.

I'm not too sure why? And the codex isn't helping much after a lot of searching.

anyone ever run into this issue? I'm stumped.



share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

If this is related to your other question, what you've got is a custom taxonomy, so you need either a taxonomy-{taxonomy}.php template (in your case taxonomy-article_topics.php), or just a more general taxonomy.php template.

(also, go back and accept answers to your other questions here if they've been solved!)


sorry, misunderstood your question-

add this to your functions.php template file to show your custom post types on tag pages:

function wpse28145_add_custom_types( $query ) {
    if( is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {

        // this gets all post types:
        $post_types = get_post_types();

        // alternately, you can add just specific post types using this line instead of the above:
        // $post_types = array( 'post', 'your_custom_type' );

        $query->set( 'post_type', $post_types );
        return $query;
add_filter( 'pre_get_posts', 'wpse28145_add_custom_types' );
share|improve this answer
I already have a taxonomy.php template, it serves as an archive for the article_topics. But the tags I'm using are site-wide already existing tags. So that's why I am confused...because this for example: <?php single_tag_title( ); ?> ...works fine, it just won't display any posts. (ok, re: accept answers...sorry). –  Nadine Sep 10 '11 at 4:22
@Nadine - see edit above. –  Milo Sep 10 '11 at 5:14
add comment

protected by Community Apr 1 at 7:31

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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