I am trying to not show the page title on certain pages, including home, a custom post types page, and a category page (/category/blog). I came up with this, and it's working for everything but the blog page.

if ( !is_front_page()  && !is_post_type_archive('location') && !is_page_template('category-blog.php')) :

<div class="page-title">
<div class="row">
<div class="col-sm-5 col-sm-offset-3"><h1><?php the_title(); ?></h1></div>
</div><!-- /row -->
</div><!-- /title -->

  • Do you mean remove it from the <title> tag? or in the loop? The "category/blog" means there's a category with the name "blog"? – 1fixdotio Mar 6 '14 at 15:51
  • Not THE title, but a title I am adding to pages. I got it figured out finally. !is_category( 'blog' ) ) – Jerry Schrader Mar 6 '14 at 15:55

Depends on what you want to do but most of the time to target blog page you will have to use :

if( is_home() || is_front_page() )

I know this could be a little bit confusing but check this link. !is_home() might be the condition you're looking for.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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