WordPress.org

Forums

Better Search
Customising search results (5 posts)

  1. Donhinio
    Member
    Posted 10 months ago #

    First of all, I must say that Better Search is easily the best search plug in I have tried (and I tried quite a few) - thanks Ajay!

    I am a complete newbie to php/Wordpress, so please forgive any stupid questions that may follow...

    Hoping someone can help with a small issue I have:

    I am using a premium theme, and have copied over the better-search-template.php to the theme directory. When I run a search, two things happen I want to stop:
    1. The right sidebar disappears completely (the search takes up the whole area between the header and the footer)
    2. Both the header and the footer distort making them double the height

    What code can I enter/change in the better-search-template.php so it only displays the results in the format of the installed theme, e.g; displays search results in the body of the page without a distorted header and footer, and with the sidebar present?

    Please could you keep any answers as simple as possible as the extent of my php knowledge is copy and paste!

    Many thanks for any help in advance.

    https://wordpress.org/plugins/better-search/

  2. franciscus
    Member
    Posted 10 months ago #

    Look at your theme's search.php page and compare it to better-search-template.php. If you cannot figure it out from there, get a programmer to do it for you. If you don't know anyone, look on fiverr.com or Elance.

    I am in the process of creating a page for the Canvas theme by Woo and I will share it with Ajay if I can make it general enough.

  3. franciscus
    Member
    Posted 10 months ago #

    I just thought of a simpler solution.
    If you enable Seamless Integration (it's an option in the Better Search plugin settings), the results will be displayed on the theme's standard search results page.
    There are only two drawbacks to this approach:
    - If you want to display a heatmap, you'll have to modify your theme's search page and add the necessary template tags.
    - Relevance percentages are not displayed (I hope Ajay will provide a solution for that in a future release).

  4. Donhinio
    Member
    Posted 10 months ago #

    Hi Franciscus,

    Many thanks for all of your advice.

    Your post 1:
    I did have a look at both files as you suggested,and tried a few things, but I'm afraid my php skills are non existent - so nothing worked. Would any required changes just be to the template results page, or would other associated files also likely need amending?

    Your post 2: When I activate seamless integration, it just refers back to the search result format for the theme.

    Thanks again!
    Donhinio.

  5. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    @franciscus, Sounds good regarding the new search template. If you do get it to work well, do let me know.

    @Donhinio, I'm afraid with premium themes, it is impossible for me to suggest any changes.
    Your best bet is to check with the theme developers and show them the better-search-template.php file and ask them what needs to be modified to get it to fit their theme.

    The seamless integration mode is usually the easiest option to make it integrate perfectly in your theme without editting any files.

Reply

You must log in to post.

About this Plugin

  • Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.