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?
Edited:
Now that I understand your question, try this…
Place this above your title to enable the post_class function.
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.