• Resolved Erica

    (@aelphabae)


    I have a search template set up, through Thesis Framework, version 2.0 but the Better Search plugin isn’t recognizing/finding it. I’m not entirely sure how to point the plugin to the proper location since there is no “clear” search.php template file.

    Any help would be great, I’d love to avoid having to redesign the entire search template to match the rest of the site if I can avoid it. ??

    https://www.ads-software.com/extend/plugins/better-search/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Ajay

    (@ajay)

    Erica, Better Search checks for a file called better-search-template.php in the Themes folder and uses that if available.

    You have a sample template file included with the plugin of the same name. The main piece of code that displays the results is this:

    <?php echo get_bsearch_results($s,$limit); ?>
    Thread Starter Erica

    (@aelphabae)

    Is there some way to disable the plugin looking for that template file? I could then add the template tag in my Thesis editor, since there is no way for me to create better-search-template.php file in my Thesis theme.

    Thank you ??

    Plugin Author Ajay

    (@ajay)

    If this file isn’t there in your theme folder, the plugin assumes this option is disabled.

    I am not sure what you mean by template tag in my Thesis editor.

    Thread Starter Erica

    (@aelphabae)

    Oh, sorry, the Thesis framework for WordPress has it’s own skin editor, which I could include <?php echo get_bsearch_results($s,$limit); ?> in the search “template” through the editor.

    Plugin Author Ajay

    (@ajay)

    Does it work if you use the code above?

    Hello Ajay,

    I think my problem is like Erica’s, only my theme is Suffusion. My default layout is “single right sidebar,” and my Search Results Page is set to use this layout.

    When Better Search is active, it forces the sidebar to the left and below the page content. After reading your advice to her, I copied better-search-template.php into the Themes Folder.

    Now it’s worse than before… The widgets in the sidebar are separated into groups along the bottom of the page.

    Maybe I need some custom code and a helping hand to add it correctly?
    ____

    Otherwise, it does exactly what I was hoping it would do. The only terms it doesn’t find are in tablepress charts, which the WP search used to find.

    Many thanks for your help, Anna
    https://forums.typeheritage.com/

    Plugin Author Ajay

    (@ajay)

    I’ve looked at the code at:

    https://themes.trac.www.ads-software.com/browser/suffusion/4.4.7/page.php

    You will need to replace the code between lines 17 and 50 with this. As usual, remember to backup before you make these changes.

    with this code from better-search-template.php

    <?php $form = get_bsearch_form($s);
    	echo $form;	?>
    	<header class="page-header">
    		<h1 class="page-title"><?php printf( __( 'BS TEMPLATE Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    	</header>
    <?php echo get_bsearch_results($s,$limit); ?>
    <?php echo $form;	?>

    YAY Ajay!

    I’m nearly code-clueless, so it took me a week to muster the courage to follow your instructions. In the meantime, I continued hunting and testing some less-scarey-sounding solutions—nothing else even comes close to What I Want to DO and Looking How I Want it to Look.

    Then I found the cPanel Code Editor with numbered lines that correspond to the ones you cited. So I held my breath and DID it…

    BINGO—it magically works like a charm on the first attempt! Now my lovely theme-customized search widget finds matches in pages AND in forum topics [this site has no “posts”].

    Thank you SO much for your above-and-beyond theme research and personal attention,

    Anna
    https://forums.typeheritage.com/

    P.S. Maybe in the next update you could extend the search range to tablepress text too? Funny, the widget I used before DID find tablepress entries [attached to WP pages because they aren’t supported by bbpress]. This feature is not so important for my forums site because most [eventually all] lines in the tables link to topics. Even so, it may be super-important for someone else.

    P.P.S. Another idea… The default Suffusion search widget offers the option to highlight “hits.” This is a nice extra even tho browser “find” features have the added muscle to navigate back-and-forth among them.

    Plugin Author Ajay

    (@ajay)

    Anna,

    Glad to know this worked well for you ??

    I need to figure out the tablepress angle. I’m not familiar with the plugin and so will need to really find some time to research this.

    The highlighting feature is something that I have in mind and I’ll put this on the list of things to do.

    Uh-oh…

    I just tried a search for the first time since updating to 3.6.1.

    Now it forces Sidebar One [far right] into the space reserved for Sidebar Two on the left of it.

    I tried replacing lines 17-50 in a new copy of page.php, and it doesn’t help.

    Once I do this, the page.php file is reduced to 25 lines:

    <?php
    /**
     * Default template for a page
     *
     * @package Suffusion
     * @subpackage Templates
     */
    
    get_header();
    ?>
    
    <div id="main-col">
    <?php
    suffusion_page_navigation();
    suffusion_before_begin_content();
    ?>
    	<<?php $form = get_bsearch_form($s);
    	echo $form;	?>
    	<header class="page-header">
    		<h1 class="page-title"><?php printf( __( 'BS TEMPLATE Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    	</header>
    <?php echo get_bsearch_results($s,$limit); ?>
    <?php echo $form;	?>
    </div>
    <?php get_footer(); ?>

    Any ideas?

    Thanks again for your extra-kind attention, Anna

    Plugin Author Ajay

    (@ajay)

    Is there some place I can check this out?

    Sorry,

    https://forums.typeheritage.com/search/

    Hoping you can fix it, Anna

    Plugin Author Ajay

    (@ajay)

    Anna,

    Can you tell me:
    1. You haven’t modified the original page.php, right?
    2. You said you created a new copy of page.php. Have you renamed the new file to better-search-template.php ??
    The plugin will only recognise this name.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Search Template’ is closed to new replies.