Created
June 11, 2013 12:51
-
-
Save INDIAN2020/5756549 to your computer and use it in GitHub Desktop.
wordpress: search short code
This file contains hidden or 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
| <?php | |
| //add_shortcode('wpbsearch', 'get_search_form'); | |
| function wpbsearchform( $form ) { | |
| $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" > | |
| <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> | |
| <input type="text" value="' . get_search_query() . '" name="s" id="s" /> | |
| <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> | |
| </div> | |
| </form>'; | |
| return $form; | |
| } | |
| add_shortcode('wpbsearch', 'wpbsearchform'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment