Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php
    $my_tot_pages = $wp_query->max_num_pages;
    if($my_tot_pages ==1) $my_tot_pages.= __(' page'');
    else $my_tot_pages .= __(' pages');
    $my_curr_page = $paged;
    if($my_curr_page =='') $my_curr_page = 1;
    $my_searchterm = trim(esc_html($s));
    if($my_searchterm !='') : ?>
    <p><?php _e('Here are the search results for');?> <span class="searchterm">'<?php echo $my_searchterm;?>'</span>.</p>

    …or Here are the search results for <?php the_search_query(); ?> somewhere in index.php, i think that theme doesn’t have archive.php or search.php.

    Thread Starter lilblogger

    (@lilblogger)

    Hi Zeo, my theme doesn’t have an archive or search page.

    It is better to make one of these pages? Is there where esmi’s code would go?

    If i use your <?php the_search_query(); ?> in the index.php file, where should I put it?

    Thanks again.

    Lily

    I’d recommend creating a search.php template file. The default theme has a search template. Try using that to get yours started.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display search terms on search results?’ is closed to new replies.