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]
- Why does ‘get_the_ID’ work outside of the loop?
- Override the default number of posts to show for a single loop?
- Get the number of posts from the current page results
- post_name empty after wp_insert_post
- Pagination not working on Custom Page Template
- Get the author of the latest revision
- Strange switch_to_blog() issue
- Multiple loops in same page, without duplicate content
- loop not displaying posts on custom template page
- JetPack Infinite Scroll not working on custom theme
- The correct way to call posts with ajax
- Is it possible to change the admin posts per page view?
- How do I detect which page I’m on within a paginated post?
- Duplicating Table of Contents for Paginated Post
- Five posts from a category in footer
- Adding specific post category between posts in loop
- Multiple loops are not reset
- Exclude category from
- Pausing and Resuming WP_Query results
- 301 (static page instead latest posts)
- Sharing post from archive page (loop) doesn’t work
- 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
- 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
- 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
- Repeating post how to solve this
- 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
- Showing content from WordPress ruins page CSS using WP_Query, without, content does not show
- Add something after all sticky posts in The Loop
- 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
- List of published post dates only outputting one date