0

I am trying to remove the title from all my category and tags page.

So far, I have been using this code http://pastebin.com/xxmyw7BP. It works but not perfectly. The title of my category and tag page is removed. However, on my sidebar, the content in my recent posts widget also lose their titles.

What other qualifier should I add other than is_archive() so that it strictly targets only the title on the category and tag pages?

Thanks.

2

I agree that editing the loop would be the best way to do this as it keep the changes local to that php template. Simply go into category.php (or archive.php) and tag.php, look for <?php the_title(); ?> and delete it or change it to <?php //the_title(); ?> to comment it out.

0

It might be better to edit those specific loops to remove the titles, that way it won't affect the lists in the widget areas.

0

If you want to go the filter route, I would use is_category() || is_tag() instead of is_archive(). Also, you probably want to use is_main_query(), so that your filter doesn't impact other queries (such as the recent posts query).

But the better approach would probably be just to create category.php and tag.php template files, in which you omit the call to <?php the_title(); ?> inside the Loop.

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.