Solved

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

Posted on 2013-12-01
7
2,198 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now