wp-show-posts
wp-show-posts copied to clipboard
Exclude sticky posts for queries with taxonomy.
By default, "ignore_sticky_posts" check box will only work post queries w/o taxonomy.
Consider changing this line of the code:
if ( $settings[ 'ignore_sticky_posts' ] ) {
$args[ 'ignore_sticky_posts' ] = $settings[ 'ignore_sticky_posts' ];
}
To this:
if ( $settings[ 'ignore_sticky_posts' ] ) {
if( ! empty( $settings[ 'taxonomy' ] ) && ! empty( $settings[ 'tax_term' ] ) ){
$sticky = get_option( 'sticky_posts' );
$args['post__not_in'] = $sticky;
} else{
$args[ 'ignore_sticky_posts' ] = $settings[ 'ignore_sticky_posts' ];
}
}