X

Display post format in your theme

Twenty Sixteen Review - widget areas

Adding this snippet to your wordpress theme will display the post format or 'standard' if no post format is available.


<?php
if ( get_post_format() ) {
    echo get_post_format_string( get_post_format() );
} else {
    echo 'Standard';
}
?>

Comments  Leave a Reply

  1. ehco ‘Standard’;
    orecho ‘Standard’;
    😉

    (thank’s by the way for all your snippets)

    1. oppps, thanks for letting me know about the typo. Glad you like the snippet.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!