get_option( 'sticky_posts' ) ,
// don't forget to paginate!
'paged' => get_query_var('paged')
);
// globalize $wp_query
global $wp_query;
// Merge custom args with default query args
$merged_query_args = array_merge( $wp_query->query, $custom_query_args );
// process the query
query_posts( $merged_query_args );
if ( $wp_query->have_posts() ) :
$i = 1;
?>
have_posts() ) : $wp_query->the_post();
get_template_part('template-parts/content', 'list');
if ( $i == get_theme_mod('content-ad-position', '1')+1 ) {
dynamic_sidebar( 'content-ad' );
}
if ( $i == get_theme_mod('content-ad-position2', '4')+1 ) {
dynamic_sidebar( 'content-ad2' );
}
if ( $i == get_theme_mod('content-ad-position3', '7')+1 ) {
dynamic_sidebar( 'content-ad3' );
}
$i++;
endwhile;
?>