I would like to create an archive page for the video post format and add it to my main navigation. Is this possible?—Pixeldapper, Studio Press Forum
Add the following to your theme's functions.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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' ); |
Leave a Reply