WordPress.org

Ready to get started?Download WordPress

Forums

Search Template (7 posts)

  1. dbUNIT16
    Member
    Posted 5 years ago #

    On my search results template, I would like to display the term that was searched for. For example, if someone searches for 'computers' I want to show on the search results page:

    Results for "computers":

    What is the tag to show the term?

    Thanks,

    Jon

  2. mojorob
    Member
    Posted 5 years ago #

    <?php echo "$s"; ?> would probably do it.

  3. iridiax
    Member
    Posted 5 years ago #

    This similar version is more secure:

    <?php echo wp_specialchars($s); ?>

  4. dbUNIT16
    Member
    Posted 5 years ago #

    Works! Thank you!

  5. dbUNIT16
    Member
    Posted 5 years ago #

    How would I call out the Category name on the category.php template?

  6. jereruira
    Member
    Posted 4 years ago #

    The 2nd solution works great. I used it in the header of the page. Neat. Thanks to mojorob and iridiax.

  7. Arnold Goodway
    Member
    Posted 4 years ago #

    <?php single_cat_title(); ?>

    This should do it with regards to the categories.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags