WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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 want to add a post title to all of my posts apart from those that are marked as "aside" or "link" post formats.

I'm currently using this code to hide the post title for aside posts;

<?php if (! has_post_format('aside')) { ?>

    <?php the_title();?>

<?php } ?>

How can I target the "link" post format aswell using this method?

share|improve this question
What's wrong with if (!has_post_format('aside') && !has_post_format('link')) ? – cjbj May 20 at 11:02
up vote 0 down vote accepted


Now that I understand your question, try this...

Place this above your title to enable the post_class function.

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

Then add </div> below your title (or excerpt, or wherever you want this special styling to end).

Now, a special class will be added in which you can use the classes for post formats. for example, you may now use .format-aside in your CSS to style the aside.

share|improve this answer
That's not really practical for this as the rest of the post is styled the same, I just want to remove the titles from those 2 formats. Surely there's a way to combine 2 post formats using if (! has_post_format())... – Dean Elliott Jan 24 '13 at 18:45
@DeanElliott - please see my updated answer above. – AndrettiMilas Jan 25 '13 at 19:34

Your Answer


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.