bloginfo( 'template_url' )
will print the URL to the page and break the return
of your function.
You need to use get_bloginfo( 'template_url' )
to concatenate the result into the string.
function clarity_wpsearch($form) {
$form = '<form role="search" method="get" id="searchform" action="' . home_url( "https://wordpress.stackexchange.com/" ) . '" >
<label class="screen-reader-text" for="s">' . __('Search for:', 'claritytheme') . '</label>
<input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="'.esc_attr__('Search the Site...','claritytheme').'" />
<input type="image" alt="'. esc_attr__('Search') .'" src="'. get_bloginfo( 'template_url' ) .'/images/search.png" />
</form>';
return $form;
}
Related Posts:
- How to redirect to post if search results only returns one post
- Possible to search by author name with default WordPress search function?
- paginate_links() don’t properly work in search.php?
- Filter the query ONLY for the search results page
- Extending the site search to include a single custom field
- Modify search function in WordPress (TwentyTwelve)
- How to customize search result page title?
- Display WordPress Search
- Search user metadata with checkboxes via ajax (almost working)
- Searching for content post
- changing behaviour of get_search_form
- Search filter by Post title OR Meta Title Value [duplicate]
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- paginate_links() don’t properly work in search.php?
- Include the post type before the title of search results
- How to rewrite wordpress search to work on specific category
- two search forms on the same page
- search form leads to 404
- WordPress: Highlight search result exact matches
- Limiting WordPress Search function : Custom build
- More than one search results page template for two searches on site
- How do i create a search option for pdf’s only
- Form output outside of container
- Limit Number of Posts on Blog Category Page Throwing 404 Error on Paginated Pages
- us states dropdown function and echo in theme template files
- Pagination in Search result
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- child_of not working while searching
- Search Woocommerce product titles only
- Custom Post Type Search
- Ajax call always returns 0
- plugins_url vs plugin_dir_url
- Where and how to put inline js in pages
- Is it possible to remove the “standard” post format?
- Hourly Routine Not Firing ( wp_schedule_event() )
- Warning/Notice about functions.php
- Is checking whether the blog is installed necessary?
- echo or print_r in an admin function
- Overriding methods in a child theme
- WP disobeys disabling of the posts revision feature
- How do I deactivate a plugin for some roles
- How to display more audio file ID3 tags in WordPress
- Running CRON on Server with WP Function
- Using separate .php file for functions – how to run on site?
- WooCommerce product search titles only
- Adding widget to dashboard with wp_dashboard_setup not working
- Register and load scripts
- Having a Function Inside of the Loop
- how to call a function only in specific pages and exclude it from other pages
- About cron delete user with meta_key
- Add dynamic links in WordPress custom theme
- Unable to login using username
- How to change the order of Jquery in the footer of my theme?
- Attempt to change jQuery version caused White Screen of Death
- media resize/crop possibilities?
- adding custom script to functions file
- edit formatting.php in a theme so it wont get overwritten
- Hook into a function without a hook?
- add_action template_redirect not working for home page
- Way to store featured image width and height in two separate variables?
- Insert template-part inside the content
- Filter yoast canonical add_action priority [closed]
- Add unique id to Preview URL
- Numbering lines of code with the tag?
- Latest Foursquare Checkin function
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- PHP 7.1 | Warning: A non-numeric value encountered in
- Way to redirect all Product Sub Category to its Main category Page?
- Fatal error: Call to undefined function is_even()
- How to use parent theme functions in child theme functions.php file?
- How Can I add a menu to the theme from withen the function.php file
- define css class in functions.php
- Adding tables to the WordPress Editor
- Add Login and logout buttons to top menu bar
- implementing a centralized content “show-do-not-show” toggle?
- WordPress – using sessions?
- How to hide content on mobile in the functions.php file – woocommerce
- Load templates, pass arguments, and render output from functions.php
- WordPress Lite/Light
- How to add HTML into error message
- Selecting specific query for offset
- Is_Page doesnt detect my page
- Security when outputing wp_oembed_get code
- Show image after X para – center aligned
- Problems adding a new field to product in cart
- Function for Sticky Post on Categories causes issues with 404 behavior
- function replace_text for entire page
- Get value of pre-populated Gravity forms field as variable in my function
- What to do to have access to WordPress functions
- Changing the color of post title [closed]
- Create html from function
- wp_list_pages change of children and anchor of parent
- Admin Panel errors because of functions.php
- WordPress not performing direct update
- Using Output from one Function and calling it into another
- How to add a class and title attribute to the link generated by next/previous post
- “Headers already sent” while trying to add a CSS file to my login page?
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- woocommerce_sort_product_tabs() expects an array