Target all posts that are NOT aside or link post formats

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;

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

    <?php the_title();?>

<?php } ?>

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

Related posts

Leave a Reply

1 comment

  1. Edited:

    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.