WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 have set up a custom post type and a custom taxonomy for it. I'm using the latest version of Wordpress. I believe I should be using the is_post_type_archive function, but this seems to be is returning false no matter what.

The post type I've set up is called articles and the taxonomy is called editions

I'm trying to access /editions/september and the archive page is showing, but the page title is showing as the first post's title. I can fix this if I can figure out how to write a conditional if statement to let me know I am in a custom post type custom taxonomy page. How can I achieve that?

share|improve this question
up vote 1 down vote accepted

Have you made sure your CPT is using the 'has_archive' => true, parameter? And try something like;

wp_reset_query(); 

 if (is_post_type_archive('articles')){
     // do something
    }
share|improve this answer

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.