How to have search form show on Results page?

Ivory Search Forums Support How to have search form show on Results page?

Viewing 6 reply threads

You must be logged in to create new topic or reply to the topic.

  • Author
    Posts
    • #1107
      Rocketman
      Participant
      • Topics: 3
      • Replies: 12

      I have 2 different search forms.
      One to search my blog, another to search pages.
      I use WP Visibility to show each form on the relevant pages.
      The blog search form only appears on blog pages, the one for pages only on appears on pages.
      Both are working, but neither show on the resources page. So I have to set Visibility on some way so if the blog search is used the blog search form appears on the results for. Similarly, when using the pages search form it should appear on the results page.
      If I set each search form to show on the Results page they both show. But I only want the search used to appear, not the other one.
      Any help appreciated.

    • #1108
      Ivory Search
      Keymaster
      • Topics: 0
      • Replies: 1,735

      I hope you are well today and thank you for your question.

      The search form URL contains ID argument which uniquely identify each search form so you can use this ID to display differnt search form based in ID value.

      To achieve this you have to edit your theme search.php file and develop PHP code in it to display differnt search forms based on ID.

      You can display search form developing PHP code as following.

      echo do_shortcode('[ivory-search id="1743" title="Default Search Form"]');

      Best regards,
      Ivory Search Support

    • #1110
      Rocketman
      Participant
      • Topics: 3
      • Replies: 12

      Vinod, I need to explain further.
      I have added 2 Ivory Search widgets to the same widget area. 1 widget uses the Blog search form, the other widget uses the Page search form.

      I have the right search page appear on the blog pages I use the Visibility option for the widget to show it only on the blog pages.
      I do a similar think to have the page search form appear only on pages.

      But if I use the Visibility option to shows the widgets on the ‘Searcg results’ page then they both appear.

      How do I make it so if someone uses the blog search, when the results page appears then only the blog search page is visible?

    • #1111
      Rocketman
      Participant
      • Topics: 3
      • Replies: 12

      This is the blog search form.

      https://snag.gy/D8Qbm3.jpg

      This is the page search form.

      https://snag.gy/O5djke.jpg

      This is the results page after using the blog search on ‘ring’. You can see both search forms appear, but only the blog one should appear.

      https://snag.gy/pnSXaO.jpg

      These are the 2 widgets. You can see the Visibility settings.

      https://snag.gy/Cy5Fun.jpg

    • #1112
      Ivory Search
      Keymaster
      • Topics: 0
      • Replies: 1,735

      I have provided you above custom coding solution to achieve it but it seems you are using a plugin to control visibility of widgets so please contact the plugin developer to achieve it as it is not related to Ivory Search plugin.

    • #1115
      Rocketman
      Participant
      • Topics: 3
      • Replies: 12

      Hi Vinod
      The Visibility option is part of Jetpack.
      I thought you may be able to help because the plugin allows me to have multiple search forms. I have 2 search forms that are shown on different areas of the site. But they seem to use the same results page. Because of that I reasoned that there must be some way to control which widget appears on the search results page. Otherwise all the search widgets will appear there together.
      I am assuming that having multiple search forms was intended to be used in this way – having different search forms for different parts of a website.
      Forgetting the Jetpack Visibility options, how would you control which search form appears when results are shown? Shouldn’t it be the search form that was used to perform the search, and only that one?

    • #1116
      Ivory Search
      Keymaster
      • Topics: 0
      • Replies: 1,735

      The Visibility option is part of Jetpack.
      I thought you may be able to help because the plugin allows me to have multiple search forms.

      Yes the plugin allows you to have multiple search forms but as you said widgets visibility is controlled by Jetpack plugin and it is not specific to search widget but you can also test it using any other widgets so please contact Jetpack plugin support to resolve it.

      Forgetting the Jetpack Visibility options, how would you control which search form appears when results are shown?

      I have already provided you custom coding solution above.

      If you can’t develop custom code then you can consider hiring a developer to develop it for you or get help from below priority support forum.

      https://ivorysearch.com/priority-support/

      Shouldn’t it be the search form that was used to perform the search, and only that one?

      Yes that is what is happening on your site but the plugin doesn’t generate search results page but the theme that you are using on your site.

Viewing 6 reply threads

You must be logged in to create new topic or reply to the topic.