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
- Remove Actions/Filters added via Anonymous Functions
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- How to add classes to images based on their categories?
- Generating Responsive Background Image Sizes in PHP
- Session is not starting
- Override a class function to include a custom template
- How to auto-update child posts whenever the parent post is updated?
- the_post_thumbnail fallback using hooks
- How to detect first visit of a user?
- Hide WYSIWYG editor on certain templates
- Disable shortlinks like ?p=1234 to prevent scraping
- Redirect a list of URLs to another URL, using functions.php
- Override woocommerce wc-class function
- How to limit character length in BuddyPress function output [closed]
- Ordering posts by publish date not working?
- Is possible add icon in title posts only in specific tag?
- Wp_schedule_event functions.php
- Can’t generate thumbnail images
- Update user meta of author when post content is viewed
- Don’t display html if function returns nothing
- Load custom css in functions.php causing library issue
- In jquery use php variable to execute an enqueued jquery file
- How to stop media_sideload_image from running when deleting a post?
- I want to display latest post in marquee [closed]
- Add php code to wp_print_scripts?
- How to get an attachment id from a filename
- Remove ‘page-numbers’ class from prev and next tags
- How can I set the SRC URL of the custom logo image?
- How to make custom comment fields required
- How do I register a new settings page? [closed]
- Include Jquery libraries in wordpress theme?
- WooCommerce -> wc_enqueue_js not working [closed]
- Use existing image sizes for WooCommerce
- Retrieve First Image Function
- User meta and public function security
- Shortcode of a function
- Conditional function for excluding first image from content, not working
- How to add a shortcode to call a function
- How can I call a PHP function inside a hardcoded shortcode?
- WordPress comment_form() does not display actual comments
- Message notification for user
- Is it possible to create a shortcode to link to a specific post/page where the tag is just an attribute?
- How can I connect to a second database and still be able to use wp functions like get_post_types()?
- Display Script in Header When URL Variable Present
- Render metabox gallery in frontend
- how to check if an element in an html file exists in another html file? [closed]
- What is the earliest Hook a Script can use?
- Trying to change widgets h-tags
- I want to display the sku in the product pages of my EDD website
- Why does echo on functions.php not yield result in source code?
- Child theme, how to cut the functions.php file into several classes?
- I want to customize the_posts_navigation function by replacing prev and next with images
- wp_footer hook causing text to show on bottom of page
- Get shortcode attribute value to another function
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- True parameter but jquery register in header and not in the footer with wp_register_script
- Instead of using $post, how do i get the thumbnail image of the $post
- List Most Read Posts from last 7 days (with custom post type and other meta queries)
- Preventing PHP Execution in Parent Theme
- How to add an excerpt and read more link to a page?
- How to shorten code with function?
- does acf_save_post cause endless loop?
- WPDB function not saving
- Integrating custom API for post content into Admin interface & Public Website [closed]
- How to save custom made object in an array in a post meta field
- Get term count on a category page
- Trying to decipher this code which is encoded with HTML Special Characters [closed]
- Which action is triggered before final output?
- Failed to open stream: No such file or directory in /home/search/public_html/wp-includes/functions.php on line 6852
- get last part of page url and add it as cat in wp_query