What you describe is not an issue but normal WordPress behaviour. When you mark a post as a sticky it will be at the top of the list and it will appear in it’s original postition as well, unless the original position is on the first page. A sticky will appear at the top of the posts and in it’s original position but it will not appear twice on the same page.
You might want to do something like this:
<?php
while (have_posts()) : the_post();
if ( !in_array( $post->ID, $do_not_duplicate ) ) { // check IDs
// display posts ...
the_title();
//store id in "do not duplicate
$do_not_duplicate = $post->ID;
}
endwhile;
?>
source with minor edit: http://wpengineer.com/1719/filter-duplicate-posts-in-the-loop/
Related Posts:
- How to limit the number of posts that WP_Query gets?
- Random sort within an already sorted query
- Code to make a post sticky
- WP_Query: Why is sticky post not first item in loop?
- how to get a different html for odd/even posts?
- Highlight a Featured Post?
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- WordPress Number of Posts Not Changing With posts_per_page
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- How to add posts to wp_query result?
- Trying to put an array into ‘post__in’ => array() query not working
- Order post by year DESC and month ASC
- How can I display a specific user’s first published post?
- Query All users that has post
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- Display page content AFTER a loop of posts
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Query how many items to show in shortcode
- Get posts by name and taxonomy term
- Get Posts that are in the current month or later
- How Can I Query a Specific Page From a MultiPage paginated Post
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- Exclude the first ‘n’ number of posts of a tag from home page?
- How to display only feautured/sticky listings on the homepage
- posts_per_page option limits the number of Gallery items
- How i can limit period of post publication?
- How to automate featured posts number? [duplicate]
- Exclude current custom post on single post
- Dynamically switch template on click
- Get all custom post types excepted some…
- Get all comments of author’s posts
- Why Query is returning empty array?
- Delete all drafts?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- post__in not working with pre_get_posts, but post__not_in does work
- How to get all post_parents of a post?
- Query for first 3 posts to change the look and feel
- Query posts and filter at query time by value of custom meta
- Run query_posts if SESSION is empty?
- Very complex post query
- Delete post revisions only for a single post
- How to give classname to post if post has no content?
- Display post by click on the link
- Exclude some posts from displaying in wp_query based on some condition
- How to retrieve certain number of images from a wordpress post?
- Sticky Post from page 2 and on
- How to convert query sql to shortcode in wordpress?
- Some doubts about how the loop work (trying debugging it)
- Issue with first top post display order
- Adjust the order for returned posts
- get last post’s link with SQL query
- Trim posts from WP-Query?
- Trying to exclude custom posts based on date, while sorting by custom field
- how to add tags to post in the Loop?
- Merge get_comments & get_posts into a single query
- How to optimize posts query in wordpress
- Sticky Post Doesn’t always work
- Query to fetch custom taxonomy along with post title
- How to fetch courses in all languages in WordPress?
- How to search through “post title” and “tags” using WP_Query?
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- I have two post types in the same query, how can I use CSS to select only one post type?
- filter posts based on menu_order
- Bulk Post update_post_meta
- Show 5 posts and than 3 posts offset with pagination
- Numbering author posts in posts query
- How to run select query of post with category and tags?
- Query posts from newest category
- wp query custom orderby not custom field
- Query post for today, if no post get the previous one
- Custom Select Query pagination not working properly
- Sort / Filter Queries
- Display the latest post from some selected authors
- Advanced Post Display/Pagination/Ordering
- Ordering posts alphabetically by meta keys and title
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Grab next post title in archive page
- Continuous listing from a custom field
- Displaying Results From Custom Taxonomy Query
- Sort post by category using HTML Select tag
- How to store post rating system data post independent?
- Get first comment link on the post itself
- WP_Query retrieve custom posts but not the post showing
- Make division in post_query?
- Display one post randomly from category on home page
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- I am using the query block and what I want and see on the editor page is not the same with the actual results
- Batch Scanning and Deleting Empty WordPress Posts
- How to make WP_Query faster when getting a post from one year ago?