Few days back I was playing with WordPress search functionality and found something interesting and it’s about voice search in WordPress.
WordPress is a great platform to build websites in a very efficient way and Nowadays Voice search is becoming a well-known feature provided by google. so Today I am going to explain how you can add voice search functionality into the WordPress site.
Its pretty simple and I didn’t expect that it’s very easy to implement. Let’s have a look into the following line of code:
1 2 3 | x-webkit-speech="true" |
The x-webkit-speech is an attribute of HTML5 input element with a type of text or search.It is very easy to enable this attribute in wordpress search.
First of all, Open your theme’s searchform.php file and place below the line of code into the input text field like
1 2 3 4 | <input id="s" class="field" type="text" name="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?> />" x-webkit-speech="true" / > |
Now, Update the searchform.php file and go to the front end and check the voice search is working with the search forms in WordPress site.
That’s it.Now you have voice search in your WordPress.
NOTE:It will only work in Google Chrome and if you have installed the extension of Voice Search or if you are using the latest version of chrome
Recommended Read:
Customize Search in WordPress
Blank Screen of WordPress Admin Panel
To get Latitude and longitude using address
Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.