WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to remove the following from the search results page, I'm using the ET Chameleon theme which doesn't have a search.php file in the editor section. Any help greatly appreciated.

Posted by auscov on Feb 22, 2013 in | 0 comments
share|improve this question
You should probably ask on Elegant Theme's Forum. Not all of us here have an account on ET. – RRikesh Feb 22 '13 at 9:05
Yeah thanks for that - I thought perhaps it might be a Theme related thing - perhaps other themes not by ET do the same thing... – Rob Feb 22 '13 at 9:18
up vote 1 down vote accepted

If the theme doesn't have a search.php file, index.php will be used.


Template file used to render a Search Results Index page

  1. search.php
  2. index.php

Use the following to print the current template being used to render a page:

add_filter( 'the_content', 'so_9405896_the_content_filter', 20, 1 );

function so_9405896_the_content_filter( $content ) 
    if( is_admin() || !current_user_can( 'delete_plugins' ) ) 
        return $content;

    global $template;
    $the_templ =  '<strong style="background-color: #CCC;padding:10px">TEMPLATE = ' 
                  . basename( $template ) . '</strong><br />';  

    $content = sprintf( $the_templ . '%s', $content );

    return $content;

Which results in:

output template name to content

share|improve this answer
Thanks that put me on the right track, the Index.php file pointed me to the PostInfo.php file which is where the rendering was being done. Thanks again! – Rob Feb 23 '13 at 1:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.