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.

On the site I am developing I have a few custom post types set up (Press Releases, Articles, Podcasts). I also have the Tag Cloud widget enabled in my sidebar.

I have tagged a post with 'Testtest', and I've also tagged a Press Release with 'Testtest'. The problem I have is when I click the 'Testtest' tag on my tag cloud, it only shows the 'Post' that I tagged, and not the Press Release.

Any idea why this would be, or a solution?

Thanks!

share|improve this question

2 Answers 2

up vote 0 down vote accepted

you can add them using pre_get_posts filter:

function myTagFilter($query) {
    $post_type = $_GET['type'];
    if (is_tag()){
        if (!$post_type) {
            $post_type = 'any';
        }
        $query->set('post_type', $post_type);
    }
    return $query;
};
add_filter('pre_get_posts','myTagFilter');
share|improve this answer
    
Thanks for your response, where would I put that code? –  Probocop Mar 10 '11 at 13:57
    
Ah nevermind, found where. That does indeed show my other post types, though for some reason my navigation disappears on the tag pages now? –  Probocop Mar 10 '11 at 14:54
    
the only thing this code changes is the post_type query on a tag archive so i can't really tell whats wrong there, if you create a pastebin of your code and output i'll know more. –  Bainternet Mar 10 '11 at 18:33
    
I have the same problem - my navigation disappears on the tag pages.I will be very grateful if you find why –  zina Mar 13 '11 at 8:40
    
Yeah we are going to need more info like what your tag page code is like –  Bainternet Mar 13 '11 at 9:07

I had the same issue, the only fix I've found so far is to wrap the menu with a remove then add of the filter to stop it from breaking the menu.

share|improve this answer
    
Please show a code sample. Thanks. –  kaiser Nov 22 '12 at 17:17

Your Answer

 
discard

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.