Skip to content

Instantly share code, notes, and snippets.

@obiPlabon
Last active November 16, 2017 19:35
Show Gist options
  • Save obiPlabon/05da75cc34c09ec606bbea1383355f65 to your computer and use it in GitHub Desktop.
Save obiPlabon/05da75cc34c09ec606bbea1383355f65 to your computer and use it in GitHub Desktop.
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'paged' => $paged,
'post__not_in' => get_option( 'sticky_posts' ),
'ignore_sticky_posts' => true,
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => 'post-format-video',
'operator' => 'NOT IN',
) )
);
if ( 1 == $paged ) {
$args['offset'] = 3;
}
$my_query = new WP_Query( $args );
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'paged' => $paged,
'post__not_in' => get_option( 'sticky_posts' ),
'ignore_sticky_posts' => true,
'offset' => 3 + ( $paged - 1 ) * get_option( 'posts_per_page' )
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => 'post-format-video',
'operator' => 'NOT IN',
) )
);
$my_query = new WP_Query( $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment