[Resolved] Search Template
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. 🙂
Erica, Better Search checks for a file called
better-search-template.phpin 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); ?>
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 🙂
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.
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.
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
I’ve looked at the code at:
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; ?>
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,
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.
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.
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(); ?>
Thanks again for your extra-kind attention, Anna
Hoping you can fix it, Anna
- The topic ‘[Resolved] Search Template’ is closed to new replies.