Title: Search string
Last modified: December 28, 2020

---

# Search string

 *  Resolved [lknoke](https://wordpress.org/support/users/lknoke/)
 * (@lknoke)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/)
 * Hi,
 * if I use the shortcode “[aiovg_search]” for a custom search page the string from
   the default search template: “Showing results for “%s” will not be shown. Is 
   there a chance to get this string back in my custom template?
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [wpvideogallery](https://wordpress.org/support/users/wpvideogallery/)
 * (@wpvideogallery)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/#post-13841482)
 * 1. Go to “Video Gallery => Settings => Advanced (tab) => Page Settings (sub menu)”
   from your “WordPress Admin Dashboard”.
 * 2. Locate the “Search Page” option.
 * 3. Select your custom search page from the select list.
 * 4. Save the changes and check now.
 * Hope this solved your issue!
    -  This reply was modified 5 years, 5 months ago by [wpvideogallery](https://wordpress.org/support/users/wpvideogallery/).
 *  Thread Starter [lknoke](https://wordpress.org/support/users/lknoke/)
 * (@lknoke)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/#post-13846893)
 * Hi,
 * thanks for the quick reply but this setting was already made. The page and the
   search is working (elementor with shortcode [aiovg_search]) but the header with“
   Showing results for “%s…” is not showing. Is this only working with the default
   search page?
 * [Link for what I need](https://ibb.co/P9fYW2x)
    -  This reply was modified 5 years, 5 months ago by [lknoke](https://wordpress.org/support/users/lknoke/).
    -  This reply was modified 5 years, 5 months ago by [lknoke](https://wordpress.org/support/users/lknoke/).
 *  Plugin Contributor [wpvideogallery](https://wordpress.org/support/users/wpvideogallery/)
 * (@wpvideogallery)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/#post-13847893)
 * The header “Showing results for %s” works only if the page uses the WordPress
   core function **the_title()** to print the page title. Your custom elementor 
   page should not be using this function.
 * **Solution:**
 * Kindly try adding the following code to the bottom of your theme’s **functions.
   php** file.
 *     ```
       function aiovg_custom_search_title( $output, $tag ) {
       	if ( 'aiovg_search' == $tag ) {
       		$queries = array();
   
       		if ( ! empty( $_GET['vi'] ) ) {
       			$queries[] = sanitize_text_field( $_GET['vi'] );				
       		}
   
       		if ( ! empty( $_GET['ca'] ) ) {
       			$term = get_term_by( 'id', (int) $_GET['ca'], 'aiovg_categories' );
       			$queries[] = $term->name;				
       		}
   
       		if ( ! empty( $_GET['ta'] ) ) {
       			$tags = array_map( 'intval', $_GET['ta'] );
       			foreach ( $tags as $tag ) {
       				$term = get_term_by( 'id', $tag, 'aiovg_tags' );
       				$queries[] = $term->name;	
       			}							
       		}
   
       		if ( ! empty( $queries ) ) {
       			$title = '<h3>' . sprintf( __( 'Showing results for "%s"', 'all-in-one-video-gallery' ), implode( ', ', $queries ) ) . '</h3>';	
       			return $title . $output;
       		}
       	}
   
       	return $output;
       }
       add_filter( 'do_shortcode_tag', 'aiovg_custom_search_title', 10, 2 );
       ```
   
 * Hope this solved your issue!
 *  Thread Starter [lknoke](https://wordpress.org/support/users/lknoke/)
 * (@lknoke)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/#post-13861955)
 * perfect! thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Search string’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-video-gallery/assets/icon-256x256.png?rev=3078876)
 * [All-in-One Video Gallery](https://wordpress.org/plugins/all-in-one-video-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-video-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-video-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-video-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-video-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-video-gallery/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [lknoke](https://wordpress.org/support/users/lknoke/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/search-string-2/#post-13861955)
 * Status: resolved