• what i would like to do is have a search box display the word “search” if the_search_query() has no value. but when someone searches for something it shows the search phrase.

    i have virtually no experience with php, and this was the best i could come up with, am i close?

    <input type=”text” value=
    <?php if(!empty(the_search_query())) : ?>
    “Search…”
    <?php else : ?>
    “<?php the_search_query(); ?>”
    <?php endif; ?>
    class=”searchboxentry” name=”s” id=”s”/>

  • The topic ‘how to state in php “the_search_query” is blank/empty’ is closed to new replies.