Solved

How to get rid of "Sorry, no posts matched your criteria." ?

Posted on 2013-12-01
7
2,641 Views
Last Modified: 2013-12-03
WordPress 3.7.1

Hi. I have a "Sorry, no posts matched your criteria." message on the front page of my WordPress site. I cannot find any way in the Dashboard or in any of the templates to omit this message. Has anyone else encountered this problem? Has anyone succeeded in getting rid of the "Sorry, no posts matched your criteria." message?

Thank you for any advice!

Eric
0
Comment
Question by:Eric Bourland
  • 3
  • 3
7 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 39688527
Eric,

Which theme are you using and how do you have the options in Settings | Reading set?

That message appears when WordPress can't find posts (duh).  But on the front page, that may be due to a specific setting or even a hardcoded theme option that looks for posts from specific category or custom post type that you haven't populated yet.

In terms of removal, you would either have to generate a post that satisfies the query assuming you can do so in context with the page design.  If not, you will need to change the settings and/or dive into the theme templates to remove the code that looks for posts.
0
 
LVL 3

Author Comment

by:Eric Bourland
ID: 39688540
Jason, you seem to be my WordPress guiding light. I am using OneColumn by van der Leest:

http://wordpress.org/themes/onecolumn

>>>That message appears when WordPress can't find posts (duh).  But on the front page, that may be due to a specific setting or even a hardcoded theme option that looks for posts from specific category or custom post type that you haven't populated yet.

I figured as much.

>>>If not, you will need to change the settings and/or dive into the theme templates to remove the code that looks for posts.

Yep -- I am gonna look around for something in the templates, starting with page.php. I will work with this for a while and get back to you.

Thank you as always.

Eric
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39688606
Okay, I'm out and about and can't dive into that theme until much later tonight but dive I will.

As far as looking around, don't look at page.php. That's the template for WordPress pages.  Instead, look for index.php or home.php in the theme folder and really look for use of the is_home() function.  That' soused to determine if the current user is on the home page of the site and may reference an include file or template.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 3

Author Comment

by:Eric Bourland
ID: 39688638
Dear Jason,

Well, I don't want you to spend a lot of time on this. =) I am sure you have many better things to do with your Sunday evening. Actually, I think I fixed it ... though I am not sure what I did. I was editing page.php; and I also changed a few things in Appearance | Customize. And then the "Sorry, no posts...." message went away.

I will try to recreate what I did so I can post it here as a record.

Your solution ("change the settings and/or dive into the theme templates to remove the code that looks for posts") was the right solution .... I will find out exactly what I did though.

Gotta go out for a while; will be back later this evening. Hope you are well.

Eric
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
ID: 39689074
Jason ... I am not sure exactly what I did. (Which I find at once puzzling and troubling, since I am usually very careful about edits I make in any template, whether PHP, ASP, or ColdFusion.) I am pretty sure I edited something in page.php, and/or flipped a switch somewhere in the dashboard. Anyway, it is working. As always, thank you for your time and expertise. I hope your weekend was excellent and not too full of development work. Have a great week.

best from Eric
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39694693
I am pretty sure I edited something in page.php, and/or flipped a switch somewhere in the dashboard

My guess is you switched Settings | Reading away from "Latest Posts" and over to "Static Page"

In my testing, that removes the "Sorry, no posts matched your criteria" message.

The other way to do it would have been to edit the Main Index Template (index.php) and look for the following lines:

	<?php the_excerpt(); ?>
		<?php endwhile; else: ?>
		<p><?php _e('Sorry, no posts matched your criteria.', 'onecolumn'); ?></p>
		<?php endif; ?>

Open in new window


You can then modify or remove the error message in line 3
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

WordPress has made it easy to create scalable sites based on their powerful CMS, but as great as WordPress is, there are some SEO issues that haven’t been addressed out of the box.  Fortunately these problems can be solved with a few plugins.  The f…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question