Created
November 14, 2011 16:02
-
-
Save ivorpad/1364275 to your computer and use it in GitHub Desktop.
Limit Number Of Words In The WordPress Search Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- I needed to limit the words in the WordPress search query to display it as a title and a long query broke the whole thing, so this did the trick --> | |
<?php | |
$my_search_query = get_search_query(); | |
echo string_limit_words($my_search_query, 3); | |
?>[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment