- This topic has 11 replies, 3 voices, and was last updated 4 years, 5 months ago by
Tom.
-
AuthorPosts
-
December 12, 2018 at 8:01 pm #755176
Visual D
Hi
Is there a way to have a custom search with the default search icon in the menu?
Using Woo search
<?php if ( function_exists( ‘aws_get_search_form’ ) ) { aws_get_search_form(); } ?>
Thanks
Edwin
December 13, 2018 at 12:11 pm #755834Tom
Lead DeveloperLead DeveloperHi there,
Is there an example of what that function outputs I can look at? Are you using it on your site anywhere?
December 13, 2018 at 2:49 pm #755981Visual D
December 13, 2018 at 9:28 pm #756132Tom
Lead DeveloperLead DeveloperNot 100% sure it will work, but try this:
add_filter( 'generate_navigation_search_output', function() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <div class="aws-wrapper"> <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" /> <input type="hidden" name="post_type" value="product"> <input type="hidden" name="type_aws" value="true"> <div class="aws-search-clear"><span aria-label="Clear Search">×</span></div> <div class="aws-loader"></div> </div> </form>', esc_url( home_url( '/' ) ), esc_attr( get_search_query() ), esc_attr_x( 'Search', 'label', 'generatepress' ) ); } );
December 13, 2018 at 9:55 pm #756143Visual D
Thanks Tom
Unfortunately that dint work.
Created Element/Hook show in every page ( wp_head) Execute PHP)
<?php add_filter( 'generate_navigation_search_output', function() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <div class="aws-wrapper"> <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" /> <input type="hidden" name="post_type" value="product"> <input type="hidden" name="type_aws" value="true"> <div class="aws-search-clear"><span aria-label="Clear Search">×</span></div> <div class="aws-loader"></div> </div> </form>', esc_url( home_url( '/' ) ), esc_attr( get_search_query() ), esc_attr_x( 'Search', 'label', 'generatepress' ) ); } ); ?>
December 14, 2018 at 5:00 am #756424David
StaffCustomer SupportHi there,
that code won’t work in the Hooks Element. Try either of the methods provided here:
December 14, 2018 at 4:51 pm #757097Visual D
Hi David
No, that didn’t work either
December 14, 2018 at 5:00 pm #757102Tom
Lead DeveloperLead DeveloperIs the code still active? I’m not seeing the necessary elements on your site.
December 14, 2018 at 5:14 pm #757111Visual D
Hi Tom
Try Now, i disabled the child theme to check something before.
December 14, 2018 at 5:19 pm #757114Tom
Lead DeveloperLead DeveloperHmm, in that case, it’s likely that the widget is relying on something internal.
Might be worth asking the plugin author if it’s possible to extend its functionality to another form on the site.
December 14, 2018 at 5:26 pm #757118Visual D
Thanks Tom. Will try to contact plugin developer
Appreciated your help as always.December 14, 2018 at 5:33 pm #757124Tom
Lead DeveloperLead DeveloperNo problem – hopefully they have a solution we can implement 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.