Status
Not open for further replies.

NightMare

Active Member
1,732
2010
247
0
Hey guys ,
i'm using wordpress theme which is pretty weird
when you search for something and there is no results it shows blank page
instead of saying no posts found , example :
072fe4888041d10823f12fed6642a259.jpg


site is : nightmarez.org if u wanted to check .

i tried to make 404 page , but it didn't help .
 
5 comments
Thats because your skin isn´t coded correctly ;)
The problem should be search.php :)

Code:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php else : ?>
        <h2>Not Found</h2>
<?php endif; ?>
<?php get_footer(); ?>

*I coded it fast by hand... so perhaps exists errors, but with a similar php code you can get what you want, the important part is the "else" conditional :)
 
Last edited:
Try the some original theme from WP, if it works properly, then you gotta fix your skin.
Check the PHP error logs too.
 
Thats because your skin isn´t coded correctly ;)
The problem should be search.php :)

Code:
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php else : ?>
        <h2>Not Found</h2>
<?php endif; ?>
<?php get_footer(); ?>

*I coded it fast by hand... so perhaps exists errors, but with a similar php code you can get what you want, the important part is the "else" conditional :)

there is only searchform.php
should i make search.php or just edit the up file ?
 
You need a search.php file, is hard to say... since i don´t know which skin you are using, and how it´s coded. But most of themes use search.php

Use google, it usually helps a lot: http://codex.wordpress.org/Creating_a_Search_Page

Different WordPress Themes feature different template files. Some include a search.php template file. This is not a Search Page, it is merely a template that displays the search results. There is also a template file called searchform.php. This is a template file that is often included in the sidebar of many themes and generates the search box form. If there isn't one in your theme, you can easily copy it from the Default theme.
:)
 
Status
Not open for further replies.
Back
Top