Remove duplicate posts in different homepage sections
-
My WP theme has few sections in homepage. By default, each section contains the last posts.
These are the first 3 sections in the homepage:
1. featured posts 1
2. featured posts 2
3. header featured postsI got the code that removes duplicated posts from the second section (see below).
How can I extend the code in order to remove duplicated last posts from the third section as well? (not a programmer)This is the code I got (and works!):
if ( $newscard_settings['newscard_banner_featured_posts_1_hide'] === 0 ) { $featured_post_1_ids = wp_list_pluck( $newscard_get_featured_post_1->posts, 'ID' ); $post_type_fp_2['post__not_in'] = array_unique( array_merge( $post_type_fp_2['post__not_in'], $featured_post_1_ids ) ); }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Remove duplicate posts in different homepage sections’ is closed to new replies.