Does WordPress generate an automatic page for post formats?

I want a page to view only a specific post format (e.g. aside).

Do I have to create my own page and run a custom query, or does WordPress have an automatic page generated for me (like the categories)?

Related posts

Leave a Reply

2 comments

  1. Take a look at get_post_format_link()

    Here’s a little example that uses get_post_format_link() to show a link to the format’s archive page. You can see something similar to this in action on Justin Tadlock’s site.

    function get_post_format_archive_link() {
        return sprintf( 
            '<a class="post-format-archive-link %1$s" href="%2$s">%1$s</a>',
            get_post_format(),
            get_post_format_link( get_post_format() ) 
        );
    }
    

    usage:

    echo get_post_format_archive_link();
    

    The URL Structure is:

    /type/{post format}/
    

    So for an aside we’d have:

    http://example.com/type/aside/
    
  2. You would need to add theme support for post formats with code.

    add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
    

    The code above is what you’d put in your theme’s functions.php file, and then in your template files, you would display each post accordingly with the following code, for example if your post format for a post was video:

    if ( has_post_format( 'video' )) {
      echo 'this is the video format';
    }
    

    See the Codex for more info:

    http://codex.wordpress.org/Post_Formats#Adding_Theme_Support