Weird Problem!, try the following:
- Make sure that the targeted categories are not empty.
- If you are using custom post type,include it in the query
'post_type'=>'advertisement'
for example. -
If the targeted categories are special taxonomies,make sure to include it in the query :
'term'=>'cars'
along with child'cars'=>'toyota'
.- in this example and just to make it clear : cars is like category and toyota is like uncategorized.
One last thing: trace the query by echoing the query to find out what is the exact arriving query:
echo $query_string;
;
place it in the top of the page before the <?php if ( have_pos...
and right after the query_posts(..);
please tell us the results of the query in case it didn’t work.
Related Posts:
- How to display by default only published posts/pages in the admin area?
- Using single.php from plugin folder instead of default template folder
- Why do I need to use The Loop on pages (inside page.php etc)?
- posts page – different lengths of excerpt
- how to display full post with pagination on home page
- Static posts page with home.php
- Pagination not working on Custom Page Template
- Multiple loops in same page, without duplicate content
- Showing random content / pictures from earlier posts in a sticky post?
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Is there any WordPress alternative to Book module of Drupal?
- Differentiate between posts and pages in search results
- Posts vs. Pages
- Blog Posts in Custom Menu
- page.php showing loop of posts and not page content
- Multiple loops are not reset
- Displaying Latest Posts on a Page
- How to make number of blog posts a custom field?
- Adding buttons to Add New Post and Add New Page
- How could I change my Permalink from blog to custom structure? [closed]
- Static posts page with home.php
- Display Posts on Custom Page
- Multiple Loops Breaking Pages
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- disable Tab post on nav-menus page (Admin)
- Custom taxonomy archive page problem
- older blog posts not showing in new theme
- Why won’t pagination work?
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- How to create a page that shows the last 10 posts?
- Querying another post category to match current post and display in loop
- Optimize CPT-function with a loop
- Pagination for normal (standard) posts on a page with a custom loop?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- posts going to 2 pages/categories only show up in 1
- Custom Post Type Single Loop Outputting Wrong Post
- How to separate each individual blog post?
- Organization of time insensitive content
- Direct some posts to only appear on a specific page
- What would causes search to return incorrect results?
- Changing permalink of WordPress
- Separate blog and reviews categories
- Create a List of Widgets, where each widget holds three attributes
- WordPress empty page! what is wrong with this code?
- Added a ACF field to custom page and want the results to show as a column in admin
- Show post count in custom taxonomy page
- How to distinguish pages created by woocommerce?
- Put page on Archived statut after end of publication date
- post and page and custom post type
- My posts page is missing the page title
- Multiple Pages – Seperate blogs
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Posts are not showing up on next page.
- Permalink base only for posts
- Custom post type – Loop out in random order but same 15 to appear first… still random
- Show Posts By Custom Field
- How can I have the posts from one word press blog show on the presentation page of another word press site
- How to show the posts list into a static page? Problems to use the loop into a static page
- Allow users to create their own page/s
- Make a custom URL and link to custom Template
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- The loop: more posts than I want to fit on one page
- adding custom meta as well as looping through posts
- Automatically delete default posts and pages on theme install?
- Redirecting posts in WordPress to a specific page
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- How to have more post in a page than in your home page
- custom post type single page template not working
- When and how will php code in a user made WordPress page be executed?
- The page that displays Posts on homepage
- How to have 2 posting pages on a blog
- What function does the loop of displaying posts?
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- Edit Page button is gone
- disable password protected page for logged users
- White Blank Page when Updating and Publishing Page/Post
- How to add pagination in between post and comments?
- Add Word Limit to Posts
- WordPress Loop – Next 3 Posts
- Display multiple custom taxonomy values on single custom post types page?
- Pulling in post category and children within category
- Getting value from get_post_custom
- show custom post type category dropdown sorting result on same page
- How to exclude visited posts from loop
- Single.php – Get Current Parent Category
- Getting blog pagination to work on page set as front page
- New Posts and Pages Won’t Save
- Display 3 posts with different HTML markup using a loop
- Hook save_post_cpt not triggered when custom fields are modified
- Is there a way to know when a page has been updated and do some action only once?
- WordPress Pods Custom Post Type – separate Media Upload folder for each custom Post Types
- Display new posts categories in separated divs
- Add Categories To Custom Post
- Edit Posts Page but not category specific pages?
- Custom Single Post Type not referring to single-post-type.php File
- index.php is only displaying current month’s posts?
- “Current” class on a singular page menu item with custom post types?
- get next/previous post name
- Get image paths from RSS feeds
- 2 tick boxes appearing below comments