Solved

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

Posted on 2013-12-01
7
2,855 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Did you use a default hosting installation of wordpress with the intention of it being your actual site?  Maybe you’ve installed it as a Blog to your current site and recently converted it to be the main site and do away with the old .htm pages.  An…
Like there are many different versions of Wordpress, there are also a handful of related side projects WordPress users should be familiar with.   All of these projects are open source and GPL licensed, which means there are few restrictions to us…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

765 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