Support » Plugin: Relevanssi - A Better Search » Theme has a blank search.php file

  • A previously developer had created a custom search functionality using Ajax that we would like to replace with Relevansi. In this process, they had deleted the search.php content. I tried replacing it with the default theme search file but it seems that the template parts that are being referenced are not there either, resulting in a blank search results page.

    Here is the default search.php: https://pastebin.com/duT3Xmdf

    Any help with getting a search.php file that works with Relevanssi would be appreciated.

    Here is an example of a search results page with the default search.php taken from the original theme: https://stagecenfri.wpengine.com/?s=africa

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Just wanted to add that the admin search works fine and that the theme is this one: https://github.com/olefredrik/FoundationPress

    • This reply was modified 1 month, 4 weeks ago by wowwalex.
    Plugin Author Mikko Saari

    (@msaari)

    That search.php looks fine. The template uses template-parts/content.php to print out the actual post content. What’s in that file?

    The theme was edited to use an Ajax search form, and it seems that all parts of the original theme search are no longer there. Do you think importing the referenced templates from the github link would be a good solution? (there are no template-parts in the edited version of the theme)

    I believe that the theme has been edited quite extensively. Is there a way of populating search results through WordPress functions? Here is the function that handles search currently: https://pastebin.com/zCe83MFu

    Plugin Author Mikko Saari

    (@msaari)

    If the template parts are empty, then nothing will print out. If you put in the template parts, then the search should probably just work.

    If you want an Ajax search form, the easiest solution is to ditch the custom work and use Search WP Live Ajax Search instead – that’s an easy-to-use Ajax search form that works with Relevanssi.

    If you want to use the current form, that’s possible too, but then you have to build your Ajax action that fetches Relevanssi results, and that’s going to be somewhat complicated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.