I use the following codes to get posts only from ‘image‘ post format and it works.
<?php if( has_post_format('image')){ ?>
<?php the_post_thumbnail(); ?>
<?php } ?>
I also need to get posts only from ‘standard‘ post format with the following codes, but it get post from all post formats.
<?php if( has_post_format('standard')){ ?>
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
<?php } ?>
Any solutions?
Do,
The standard post format isn’t actually a post format, so if you conditionally check whether a post contains a post format (other than the default standard), it will return
false
, because it’s set to… standard.Try this: Exclude all rest terms using ‘NOT IN’ operator.