Without looking at the database data (posts, inherits, etc), it’s a bit of guesswork.
Try the following:
- Make sure you have
"post_type"=>"post"
specified, so that you don’t get auto-saved inherits (if it defaults to ‘any’). - If this is an isolated query (not meant to be main loop), use $q = new WP_Query() and run it through that instead of get_posts().
- What does setup_postdata do? Does it accidentally rewind anything?
- Try escaping the category loop and apply
get_category_by_slug('latest')
to “category” (it returns an object with ID) to the call.
Related Posts:
- How to get Images included in Post
- How to know if get_posts() failed?
- How do I sort (order) the results from `get_children()`?
- how to display full post with pagination on home page
- Post & edit a post from front end along with upload, dropdown, and other inputs
- How do I change the gallery that is inserted in the post?
- Posts Page Featured Image [closed]
- Displaying Page Title on index.php
- How to enqueue scripts depending on post formats?
- How to Replace the WordPress Featured Image with a Video?
- Convert a complex webpage into WP theme
- How to load a different header based on post format?
- Changing next and previous post link text
- Understand post type
- Mark menu item as current-menu-item for category
- Understanding and using metaboxes in posts
- Why won’t my taxonomy query show up?
- Admin Notices don’t display on the admin screen for certain post
- Why orderby=”date” does not support manually changed posts?
- Static page does not show my posts
- I am unable to publish/update post
- page.php showing loop of posts and not page content
- Custom WordPress Theme: Publish Date and Display Date for posts right beside each other
- How to show single post page as home page
- Exclude category from
- Blog page not working
- How to display the link (title) and thumbnail post?
- Underscores Theme Unit Testing – Catching Untitled Posts
- get_the_excerpt() is not working as expected – returns wrong text
- How to use format post in a pertinent way
- Unable to restore from backup – how to obtain old blog posts?
- Disable sticky option for specific categories
- Highlight static blog page link in header
- How to create a template for Pages?
- How do I do a page break?
- Block editors annoying warnings
- What does WordPress do if I save a post without content/title? [duplicate]
- How to add a class to edit_post_link?
- Admin – no Featured image choice in create new/page|post
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- how to hide empty fields of post category description?
- Give posts a particular template based on the assigned category
- Display Featured Posts Grid on Static Page (Gazette)
- how to handle the loop using filling bootstrap grid structure?
- Cant’ Grab WordPress Built-in Posts Through Loop
- Change default post style to columns
- How do I allow certain users to make a certain type of post?
- How to add a post class on every post. (on homepage)
- I can’t find the relevant part of the loop in my theme file. How do I find the full content with “More…”
- WordPress Architecture as a CMS – Posts & Pages
- Change modified date to current date when title updated automatically
- Add a field in my rest api
- Permanently deleted posts still exist
- created post displaying differently on front end
- Aligning images in the wp editor not working. How do i get this to work in custom theme?
- How to pull latest posts from a specific category
- Problem paginating a subquery on a post
- Moved a website and excerpts don’t work for old posts
- How to prevent clicking on posts
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- Integrate video and iframe in a post type gallery
- How to put the WordPress blog into theme
- Display post order ranking within wordpress loop
- Displaying a specific sub-category’s posts from wp_query
- Trim excerpt to first paragraph
- Posts only showing on /localhost/wordpress/ and not on other pages
- Post are not showing up
- Blog styling in SASS
- How to show the posts list into a static page? Problems to use the loop into a static page
- WP Load post with ajax and apply isotope
- Display the current post author and his url in the post header
- wordpress taxonomy results
- Which hooks are essential for post templates?
- Get most recent posts by category that aren’t first overall [duplicate]
- The post order is different for logged-in and non-logged-in users? [closed]
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Convert HTML5 to WordPress theme
- Change from all posts to specific categories post on main page?
- Wp_query WooCommerce products
- Get posts after calculating meta key
- No matching template found when using single.php
- Is there a block to print post link standalone in a block theme?
- WordPress Ajax load doesn’t work
- Accessing the post content with WP_Query
- Add a special filter link to All Posts in admin
- Create pretty permalink for a post knowing the permalink structure
- jQuery inluclude still seems ncessary for script to work within post
- Why is querying posts messing up my pages?
- WordPress Loop – Next 3 Posts
- Display post category in foreach loop
- Date is wrong on ‘all posts’ page
- How do I disable the “by author” hyperlink on posts?
- Recent posts script mess up blog posts
- Featured Images most often doesnt appear
- Why is WordPress showing a blank excerpt for just one of my posts?
- Is there a way to know when a page has been updated and do some action only once?
- update post category in a new table on frequent change of category
- How can add metabox for post of specific category before save post and after save post [duplicate]
- Posts page template: How can I edit the markup for this?
- Should new posts already have tags?