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
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- wp-cli post create & media import issues
- More then one menu items are assigned with “current-menu-item” class
- Append class to posts page
- How can i limit the number of posts created per category?
- Search results posts_orderby and ID
- Pausing and Resuming WP_Query results
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Pulling in post category and children within category
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- Post categories to pages
- Switch to page template when using post permalink
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Post Loop Missing Most Recent Post
- 301 (static page instead latest posts)
- Integrate OpenStreetMap on WordPress
- What’s the best way to render Visual Composer in posts, not pages?
- Trying to use AngularJS with WordPress without any API
- How to : pagination in 3 different custom loops on the same page