Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 down vote accepted

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

Template_Hierarchy

Template file used to render a Search Results Index page

  1. search.php
  2. index.php

[update]
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

 
discard

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.