I have checked your code please compare your WP_Query args with mine. Also, have a look on the available WP_Query args.
$queryArgs = array(
// Do not get posts from the Uncategorized category.
'cat' => '-1',
// Order by date.
'orderby' => 'date',
// Show all posts.
'posts_per_page' => '6',
'post_type' => 'portfolio',
'post_status' => 'publish',
);
$query = new WP_Query( $queryArgs );
Hopefully! It will work for you 🙂
Related Posts:
- Disable Attachment Pages Completely
- Inject post (from specific category) between posts in Loop
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- How to get year, month and hour in WordPress?
- Print number of post (in reverse)
- Count number of published posts by type
- WP Insert Post function – Insert Post Thumbnail
- How is WordPress manipulating the posts like there are folders?
- Get taxonomy terms only of the WP_Query current posts
- How to get 2 or multiple custom post types in wordpress functions.php
- Displaying a button on each post
- Creating bulk posts with Youtube videos
- Getting a specific post values to another div or modal
- Unreadable pagination
- how do I get a specific post from a post with a subcategory in WP
- Which hook/action will help me solve my problem?
- Open post-content in archive page in a Modal box with bootstrap
- Get children post mime type using parent post_ID wp_post
- Display related posts without a plugin
- Count posts on multisite with blog id
- Making (and edit existing) posts with ID included
- Parsing Menu Items and Blog Posts
- Pagination on Custom Post
- $wpdb returns duplicate posts
- How to show an entire post content and not also the excerpt?
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- WordPress query undefined offset in loop
- WP_Query: getting posts where custom field exists
- Increment paged on WP_Query
- How do I add more options to the post-new.php page?
- get post id from wp_insert_post for get_template_part
- Modify main query before it run without pre_get_post
- .html end of URl affected to SEO?
- Get the id of all images in a post
- Displaying content on posts page based on category
- how to make an array of post id’s in is_single
- Loading Posts & Category with Ajax
- Four posts per row [closed]
- array_rand not working correctly?
- Update if post with specific title exists
- Need help removing […] after excerpt
- WP_Query() load selected post
- Unable to render custom field after attempt to generate a list of recent post in page template
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Pagination in single.php
- understand what code is doing when prepending /blog
- Advanced Query posts
- My worpress search page is showing no results
- duplicate posts with ajax load more wordpress
- My Custom Post Type AJAX Query is Returning no posts – why?
- How to display 8 posts in four columns and 2 rows on a carousel slide?
- How to get post image caption by index
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- Is there anyway I can call the year once?
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- Check $post->ID against multiple values
- Don’t update modified post date when user add a product review or comment?
- Limit the number of characters/words in an excerpt for a related posts section
- Posts missing on author page
- How to allow users to save list of posts in wordpress?
- Show a text if the post has written by author user role in WordPress
- Getting info about selected posts using one WP_Query
- Closing Comments conditionally in comments.php
- Change upload URL by mime type
- How to center all text body in single.php at once?
- Having trouble with customizing blog posts on the home page
- Related Posts: if there is no category use tags
- WordPress post insertion from PHP file
- How do if all posts has this category ID then do this
- Make sticky post with FacetWP
- Getting page / post URL on publish and / or update
- Get current_post in reverse order with pagination
- Getting error in sql query
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Insert div after every three posts in home.php [duplicate]
- PHP tag in post content makes wordpress go crazy
- Unable to get Post Category Name and URL
- Dynamically Create Posts Via XML File
- Basic PHP question (displaying post title over thumbnail) [closed]
- insert thumbnail image from php script
- Post from front end form to post_meta
- media_handle_sideload() returned post_id being incremented
- Saving Post redirects to 404 page when php $_GET variable in post body
- How can I add WordPress Audio Player as featured audio in Audio Blog Posts?
- Trying to see if page is category or single and displaying title with appropriate heading tag
- link to page_for_posts
- How to customize posts in WordPress by using HTML and CSS?
- foreach all the post
- How to create a loop that will display one post and stop?
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Add multiple HTML attributes to an Elementor button
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Bulk data save in custom table
- How to change post date and post time in WordPress automatically with a function
- Global update of records after import WP All Import Pro
- Display posts based on the selected category when no subcategory is chosen
- How to display only the first 2 words of a post title