$do_not_duplicate is not working in genesis theme
I'm using Genesis child theme and I am using this function to display feature posts on home page.
function modern_motoroids_extra_feature_posts(){ ?
?php $do_not_duplicate = array(); ?
?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?
?php query_posts( array('meta_key' = 'feature-story', 'orderby'= 'date', 'paged' = get_query_var( 'paged' ), 'posts_per_page' = 4, 'post__not_in' = $do_not_duplicate)); ?
?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?
?php $do_not_duplicate[] = get_the_id(); ?
?php echo get_the_titke(); ?
?php endwhile; endif; ?
?php wp_reset_query(); ?
?php }
add_action('genesis_before_content_sidebar_wrap','modern_motoroids_extra_feature_posts');
Then I am using this function to show latest posts on the same page.
function latest_feature_posts(){ ?
?php $do_not_duplicate = array(); ?
?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?
?php query_posts( array('orderby'= 'date', 'paged' = get_query_var( 'paged' ), 'posts_per_page' = 10, 'post__not_in' = $do_not_duplicate)); ?
?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?
?php $do_not_duplicate[] = get_the_id(); ?
?php echo get_the_titke(); ?
?php endwhile; endif; ?
?php wp_reset_query(); ?
?php }
add_action('genesis_before_content_sidebar_wrap','latest_feature_posts');
Problem is Its still showing duplicate posts, even after using $do_not_duplicat
. I tried to search on google and stackoverflow but didn't get anything. Please help me. Whay these functions are showing duplicate posts? and how to exclude them.
Topic globals post-duplication loop genesis-theme-framework Wordpress
Category Web