• Resolved jackson225

    (@jackson225)


    I’m interested in changing the title of the page that is generated after an unsuccessful search. For example, if I try to search for some gibberish word, I get the page with the title “Search Results for : gibberish word”, with a little magnifier. I’m ok with the magnifier, but I would like to remove “Search results for:” because the site is multilingual. Also, is there a way to remove the Churchill quote from the same page and maybe add my own text/links/image or similar? I’m sorry I can’t post link because the site still sits on a local server. Thanks in advance for any suggestion!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jackson225

    (@jackson225)

    Follow up: I just realized that what I’m interested in applies also to any search one does. But my question(s) remain the same. Thanks!

    OK, to remove the Churchill quote add this to your Child Theme functions.php:

    add_filter('tc_no_result_content', 'rdc_no_result_content');
    function rdc_no_result_content(){
                  return sprintf('<div class="%1$s"><div class="entry-content %2$s">%3$s</div>%4$s</div>',
                      apply_filters( 'tc_no_results_wrapper_class', 'tc-content span12 format-quote' ),
                      apply_filters( 'tc_no_results_content_icon', 'format-icon' ),
                      sprintf(get_search_form( $echo = false )
                      ),
                      apply_filters( 'tc_no_results_separator', '<hr class="featurette-divider '.current_filter().'">' )
                  );//end sprintf
    }

    All the .mo/.po files include the translated text so not sure why you can’t use that? (Being UK, I don’t tend to dabble in multilingual sites).

    Thread Starter jackson225

    (@jackson225)

    rdellconsulting, sorry for this really late reply and thanks for answering!
    As a temp solution for “hiding” search title I created a filter:

    add_filter('tc_search_results_header_content' , 'my_search_content');
    function my_search_content($content) {
    return '';
    }

    Also, for the hiding of the quote(s), I used CSS:

    article.error404 .entry-content blockquote { display: none;}

    I also read about Say what? plugin, so I’ll give it a try and see what comes out of it.
    Once again, thanks for the reply!

    J.

    Thread Starter jackson225

    (@jackson225)

    marking it resolved

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Change title on search generated page’ is closed to new replies.