• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Post Format Archive

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Post Format Archive

This topic is: not resolved

Tagged: archive, Post Formats

  • This topic has 6 replies, 2 voices, and was last updated 10 years, 1 month ago by pixeldapper.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • May 6, 2016 at 4:21 am #185079
    pixeldapper
    Member

    Hi!
    I would like to create an archive page for the video post format and add it to my main navigation. Is this possible?
    I am using the Digital Pro Theme

    http://prototypes.superhappypath.co.uk/dads
    May 6, 2016 at 5:18 am #185084
    Victor Font
    Moderator

    Post formats are WordPress taxonomies. You can filter a query for a specific page by taxonomy. I cobbled this code together for you, but it may need further tweaking. I don't have a way of testing it in my local environment. I don't use post formats.

    function filter_video_format_posts($query) {
        // change 999 to the page id for your archive page
        if ( !is_page ('999') )
            return $query;
    
        $taxquery = array(
            array(
                'taxonomy' => 'post_format',
                'field'    => 'slug',
                'terms'    => array( 'post-format-video' ),
            )
        );
    
        $query->set( 'tax_query', $taxquery );
    
    }
    add_action( 'pre_get_posts', 'filter_video_format_posts' );

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 6, 2016 at 7:53 am #185092
    Victor Font
    Moderator

    Try this. I replied to this post earlier, but for some reason the answer didn't show up.

    Post formats are WordPress taxonomies. You can filter a query for a specific page by taxonomy. I cobbled this code together for you, but it may need further tweaking. I don't have a way of testing it in my local environment. I don't use post formats.

    function filter_video_format_posts($query) {
        // change 999 to the page id for your archive page
        if ( !is_page ('999') )
            return $query;
    
        $taxquery = array(
            array(
                'taxonomy' => 'post_format',
                'field'    => 'slug',
                'terms'    => array( 'post-format-video' ),
            )
        );
    
        $query->set( 'tax_query', $taxquery );
    
    }
    add_action( 'pre_get_posts', 'filter_video_format_posts' );

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 6, 2016 at 7:53 am #185093
    Victor Font
    Moderator

    I tried to answer your question twice and neither time would the answer display.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 6, 2016 at 8:03 am #185097
    Victor Font
    Moderator
    function filter_video_format_posts($query) {
        // change 999 to the page id for your archive page
        if ( !is_page ('999') )
            return $query;
    
        $taxquery = array(
            array(
                'taxonomy' => 'post_format',
                'field'    => 'slug',
                'terms'    => array( 'post-format-video' ),
            )
        );
    
        $query->set( 'tax_query', $taxquery );
    
    }
    add_action( 'pre_get_posts', 'filter_video_format_posts' );

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 6, 2016 at 8:08 am #185098
    Victor Font
    Moderator

    I just tried posting the code by itself and it won't post., so I created a Gist that has the code: https://gist.github.com/vfontjr/9836af69d6bc2e01926c9b7503d0309f


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    May 9, 2016 at 4:03 am #185256
    pixeldapper
    Member

    Thanks Victor,

    It seems that the answer was appearing. Thank you so much for your persistence. It works great!

    Laurence

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble