- This topic has 1 reply, 2 voices, and was last updated 7 years, 11 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Pro Themes › Education Hub Pro › Search button
Tagged: search button
Hello,
how can I change title of search button? I know how to change text in search form input but I have problem with title of search button.
Best regards
🙂
Hello @pklima,
The feature to change the search button text (“Search”) is not directly available in the theme Customizer currently. However, you can modify it with the child theme creation approach.
To learn more about child themes see the link here : https://codex.wordpress.org/Child_Themes
To automate the task of child theme creation you can also choose to use plugins like : https://wordpress.org/plugins/wp-child-theme-generator/
After successful creation and activation of the child theme paste in the following code block in your child theme’s functions.php file :
function education_hub_customize_search_form() {
$search_placeholder = education_hub_get_option( 'search_placeholder' );
$form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
<label>
<span class="screen-reader-text">' . _x( 'Search for:', 'label', 'education-hub' ) . '</span>
<input type="search" class="search-field" placeholder="' . esc_attr( $search_placeholder ) . '" value="' . get_search_query() . '" name="s" title="' . esc_attr_x( 'Search for:', 'label', 'education-hub' ) . '" />
</label>
<input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button', 'education-hub' ) .'" />
</form>';
return $form;
}
After you have pasted in the code, find the line containing <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button', 'education-hub' ) .'" />
and replace the word ‘Search’ with your desired text to show on the search button.
Save your changes and the text will be changed in your website.
Hope this Helps,
Best Regards !!
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |