WordPress.org

Forums

Advance WP Query Search Filter
Display Search Results on a Specific Page (5 posts)

  1. in omnia paratus
    Member
    Posted 3 months ago #

    Hi there,

    I would like to know how can I display the search results on a specific page?

    Also, I have multiple boxes (that are working trough a drop down plugin that shows more information as it opens) that are the target of the search. But when I have the search results, the title of this box appears but as a permalink, not has the intended box with its content. How can I fix it?

    Tks

    http://wordpress.org/extend/plugins/advance-wp-query-search-filter/

  2. TC.K
    Member
    Plugin Author

    Posted 3 months ago #

    The plugin using your theme search.php template by default. So you can customize your search.php in order to fit your need.

    Here is how have to do:
    in the search.php while loop

    if(wp_verify_nonce($query->query_vars['s'], 'awqsfsearch') ) //this will verify that the search is from the plugin
    {
    //here you can add your own style of your result.
    }
    else{
    goto your default search result style.
    }
  3. thatwastaxing
    Member
    Posted 3 months ago #

    Thanks! How do I use this if I have 2 different search forms based on 2 different CPTs that have different results templates for each?

  4. thatwastaxing
    Member
    Posted 3 months ago #

    Might it be possible to choose which template we want to use for the serch results in your next update? Thanks!

  5. TC.K
    Member
    Plugin Author

    Posted 3 months ago #

    Hi,

    How do I use this if I have 2 different search forms based on 2 different CPTs that have different results templates for each?

    Well, it can. By just editing the code above:

    if(wp_verify_nonce($query->query_vars['s'], 'awqsfsearch') ) //this will verify that the search is from the plugin
    {
     if($_GET['formid'] == '111'){
        //template for your form with id = 111
      }
       if($_GET['formid'] == '222'){
        //template for your form with id = 222
      }
    
    }
    else{
    goto your default search result style.
    }

    Might it be possible to choose which template we want to use for the serch results in your next update?

    It is possible, but will be not included in near future. Depends on my workload and times.

Reply

You must log in to post.

About this Plugin

About this Topic