Home / loop / Display post format in your theme
  • How to Display post format in your theme

    display-post-format-in-your-theme

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

    ( click code to copy )

    wordpress snippet : PHP

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

    ( WordPress codex functions, hooks, in this snippet. )

    get_post, get_post_format,
  • Anonymous

    ehco ‘Standard’;
    orecho ‘Standard’;
    😉

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

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