You can do that using jQuery’s focus
function. add following into your php file inside <script>
tags.
$("#your-searchinput-id").focus(function() {
$("h4.title_sidebarsub").text("<?php echo $string ?>")
});
$(this).blur(function() {
$("h4.title_sidebarsub").text("mijn gemeente")
});
Related Posts:
- Can I force WP_Query to return no results?
- Pagination not working for Custom search form & custom result template
- Refine search results using WP_Query
- Custom Search Not Consistent with Results
- How to make search for posts using get method?
- How do I get my custom query to work with search results after the first page?
- Search.php – return number of results but cannot loop through
- Custom search (wp query by custom fields)
- Some doubts about how the main query and the custom query works in this custom theme?
- Using a custom WP_Query with get_template_part loop
- Loop within a loop?
- Display posts the match taxonomy term linked from wp_list_categoies?
- How to order posts tag by tag?
- Want to redirect if search query match exact title of any post
- Merging a complex query with post_rewind and splitting posts into two columns
- Pagination wont work with search results template [duplicate]
- Pagination Not working on Home Page with 2 Query
- meta_query not working properly
- WP_Query with many meta_query arguments taking a long time to load
- Exclude post on loop by multiple meta key value
- Search – Ajax – Alter Query Parameters with Pagination
- Sort by meta key on archive page
- Query sticky posts with thumbnails
- Show all parents and children in custom post type in right order
- Why is this coming back as null? Thats wrong. There is one post
- Searching through different categories on different pages code is not working
- Ignore post by meta value in the main query
- WP_Query’s “request” SQL Query
- How to retrieve current page WP_Query arguments?
- is_search was called incorrectly
- WP_Query doesn’t get sticky post at the top, when used in a page template
- How do I search inside specific taxonomies in WordPress
- How to limit WP_Query to one result on the loop?
- Complex date range with WP_Query and BETWEEN
- Multiple Loops Inside a Function
- Random loop with code to prevent duplicate output returns no output at all from time to time
- How to loop for every result found in the_content() when using the search query?
- How to use offset in WP_Query
- showing all search result in one template
- Multiple loops without repeating content
- Multiple Search Terms WP_Query
- Filtering posts from different categories into different section by doing WP_Query only once
- WP Query Args – Title or Taxonomy Value
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- Categorising search results based on Custom Fields
- How to get list of posts from permalinks?
- using pre_get_posts for search results not found
- Custom taxonomy.php not working
- different for loop if screen resolution < 1000px
- Transient api Caches confused
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- sort and display posts by custom field (wp-query and the loop))
- Redirect Search to Form When No Product Results Are Found
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- Issues with search after added meta_query
- inserting content of 1 Post to in another with a template hierarchy
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- Pagination for custom loop on custom page template is not displaying anything
- Filtering by multiple conditions in the loop
- How to access $wp_query object from array of posts given by get_posts?
- Display all attached image of every post of custom post type and link to original post
- Get posts with no tags?
- Writing less unnecessary code with WordPress
- WordPress Queries Not Working?
- Filter subpages in while loop from WP Query object
- How to filter a static post page with ajax and $wp_query
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Custom query does not find pages
- How to sort by most watched in X days/months
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- $wp_query->found_posts not returning correct value
- How to search by slug and old slug in single API
- How can I use arrays and a foreach to generate many lists with WP_Query?
- How to use custom page for all posts with custom url, call another directory?
- display ACF repater field in archive page
- Pagination repeating posts on search results
- WP_Query breaking the loop in a nested loop
- Categories In English version showing not canonical URL, instead shows query search result
- Filter admin ajax data by url query
- Related posts queries
- How to debug none working search query?
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- update_post_meta() not updating
- why default wordpress loop not working outside index.php
- how to show more than 1 post into three columns query
- A very strange problem with search query
- active link for most recent post on vertical tabs
- custom query – offset to pagination
- WordPress WP_Query Array Custom search via taxonomies
- Manipulating a query
- Display First posts without the default featured image
- How ‘secure’ are loops?
- How to do a loop inside a loop?
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?