WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trouble with is_post_type_archive() (6 posts)

  1. coopersita
    Member
    Posted 3 years ago #

    I have some content in my sidebar that I don't want to show in one of my archives for a custom post type.

    I tried using if (!is_post_type_archive('mytype')), but it doesn't seem to work.

    I also tried this: if (get_post_type() != 'mytype' && !is_archive()), but then the home page hides it as well. And adding !is_front_page() or !is_home() doesn't seem to affect it.

    Any tips?

  2. coopersita
    Member
    Posted 3 years ago #

    No one? is is_port_type_archive() working fine for the rest of you?

  3. Cristiano
    Member
    Posted 3 years ago #

    I have the same problem!!

  4. Cristiano
    Member
    Posted 3 years ago #

    @coopersita, do you use the Custom Post Type Archives plugin? That was my problem...

    If is that your case, take a look:
    http://wordpress.org/support/topic/plugin-custom-post-type-archives-is_post_type_archive?replies=2

  5. coopersita
    Member
    Posted 3 years ago #

    Nope, I don't have that plugin installed...

  6. coopersita
    Member
    Posted 3 years ago #

    Found my problem. I needed to add:

    `<?php wp_reset_query(); ?>'

    My custom queries where messing up things.

Topic Closed

This topic has been closed to new replies.

About this Topic