• Resolved webam

    (@webam)


    hello I wanted to know if there is an easy way to insert the search form in another place or if it too has a shortcode or a code so that I can then customize it and place it in a personalized place on my website.

    look at the example

    module-search

    • This topic was modified 6 years, 1 month ago by webam.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    If you want the top search (on red background) to search in the Adverts instead of posts you would need to customize the search form and make sure that:

    1. form “action” param is set to the page with [adverts_list] shortcode.
    2. the text input name is “query”.

    How to do that i am not really sure, as this search form is part of the theme (i think) it would be best to ask the theme author about it.

    One workaround you can try is to add the code below in your theme functions.php it should redirect the searches in the top bar to your page with [adverts_list] shortcode.

    
    add_action( "wp", function() {
        if( isset( $_GET["s"] ) && ! empty( $_GET["s"] ) ) {
            $url = get_permalink( adverts_config( "ads_list_id" ) );
            $url = add_query_arg( "query", $_GET["s"], $url );
            wp_redirect( $url );
        }
    });
    
    Thread Starter webam

    (@webam)

    Hello thanks for the reply. The screen that I showed you not, the search bar I designed it with Photoshop to make you understand what I wanted. I have a “jet search” plug-in so if I set jet search on the header I can then make it refer to the shortcode advert_list. Now I try

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom search form’ is closed to new replies.