?
Solved

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

Posted on 2013-12-01
7
Medium Priority
?
4,200 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
6 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 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
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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 Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
Suggested Courses

862 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