I am assuming you are doing something like this:
if (have_posts()) {
while (have_posts()) {
the_post();
if(x == j){ //inject post here }
}
}
Injecting a post inside the Loop like that will cause the post count for that page to differ from the posts_per_page
value, but it will not break pagination (which seems to be your primary question). Pagination operates on the main query (usually) and that will not be altered by your insertion.
I don’t know how you are retrieving the additional post data but if you are not careful you can break things with that.
Related Posts:
- Blog post per page setting conflicting with custom WP_Query?
- How to get posts published between a date and today?
- Display all posts from specific categories on a page
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- Can’t show comments count per post outside loop
- How to Display Post View Count
- Different amount of posts on homepage than paged pages
- Converting multiple loops into one single loop with pagination
- How would I get 1 latest post from a query for 5 posts?
- How to display different number of posts
- Inserting custom data to the_post() during loop
- How To Get Posts With A Specific Word
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Display all posts that were published before full post on single.php
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Blog page pagination is not working after using the offset argument
- How to : pagination in 3 different custom loops on the same page
- Pagination with an array of post objects?
- Start WP Pagination From Number 1 in URL
- Use two different post_per_page limits with infinite scroll
- How to order posts in an arbitrary order?
- Display Posts on Custom Page
- Wrong post title displayed from loop
- Get the amount of posts on a current page
- How to get posts published on the latest date?
- How to only publish posts with image in it
- Getting blog pagination to work on page set as front page
- WP_Query: Show 10 posts in date order, first three random
- Display specific posts on home page
- Display 3 posts with different HTML markup using a loop
- Pagination for normal (standard) posts on a page with a custom loop?
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- How to show post views shortcode data for each post on Posts List Page?
- How can I get the last post while on the first post for pagination? As if it were infinite
- Can I Paginate Post after every 25 tag?
- Use special template for the first post in the loop
- Posts are not showing up on next page.
- Modify WordPress loop after it has been run
- show latest authors blog post
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Adding a category at even positions on main loop with modified pagination
- Not displaying any articles on a custom made file
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- query_posts different amount of posts per page [duplicate]
- Print Current Post Index number within Loop
- the_author() returns empty string
- How to show list of posts by author and category?
- How to display posts by current user/author in a custom page template?
- WordPress Number of Posts Not Changing With posts_per_page
- Setting pagination for images attached to a post
- Find most recent authors
- Insert custom div between posts
- Displaying the number of posts in a custom loop (without including the number of posts of a loop below)?
- A way to detect which page a post is on
- Unwanted Duplicate Posts Showing in Pagination Pages
- Lazy Load using WP_Query pagination
- Alternating post layout
- Check to see if specific loop has less than certain amount of posts
- Pagination on single post page?
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- is there a way to show the the post title after the image?
- Post Loop Missing Most Recent Post
- Display an author’s posts on his own author page
- How to get posts from a current post’s month?
- While loop articles – if statement order
- Page and post loop same template
- Only show featured image on first page of paginated posts
- Post Filtering by GET URL parameters
- Get post by tag
- How to display posts on custom page without declaring a posts page in reading settings?
- Custom WP_Query not working correctly
- Echo the number of posts being displayed
- Exclude a category of posts in author template
- Get posts from current category?
- posts going to 2 pages/categories only show up in 1
- Go back to the exact post page number
- Pagination Stops
- Display specific posts based on an ID of another post
- How to distinguish pages created by woocommerce?
- Moved a website and excerpts don’t work for old posts
- Count posts for pagination
- how to call recent post content in a loop ( only the content before read more tag)
- Can the_post_navigation() be outside of the loop?
- How to get all posts in gallery post format template
- Show Posts By Custom Field
- Querying multiple categories in the WP loop if one of the category IDs is dynamically obtained
- Post gallery as carousel
- Add something after all sticky posts in The Loop
- Automatically create a loop for post ID
- Display Post by menu order
- Can’t get pagination to work
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Single post pagination
- WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]
- posts_per_page – Repeats only first posts ‘post__in’ array
- Show a page counter for pagination
- Sort Posts Alphabetically Based on Specific Category (Divi)