WordPress.org

Forums

Better Search
[resolved] Remove "results-per-page" (12 posts)

  1. phantasmix
    Member
    Posted 1 year ago #

    Is there a way to get rid of the results per page row?

    Thanks!

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

  2. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    The only way to do that right now is to edit the plugin or create your own template file for the results

  3. phantasmix
    Member
    Posted 1 year ago #

    Hi Ajay,
    I created my own template (better-search-template.php in my theme) and for the most part I got it to look the way I want, but I don't see a line that would help me get rid of that row. It doesn't have a class either - that way I could at least hide it.

    Thanks!

  4. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Can you post the code you're using for the template right now?

    I'm rewriting some parts of this code to make it more class friendly

  5. phantasmix
    Member
    Posted 1 year ago #

    It's pretty much the default :)

    <div class="better-search-form-bar">
     <?php $form = get_bsearch_form($s);
    	echo $form; ?></div>
    
    	<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'plastics' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    
    	<?php echo get_bsearch_results($s,100); ?>
    
    	<div class="better-search-form-bar">
    	<?php echo $form; ?>
    </div>
  6. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    You could consider breaking down the get_bsearch_results code based on the code in the function. It should allow you to customise exactly what you want in the results.

  7. phantasmix
    Member
    Posted 1 year ago #

    I went the lazy route for moment: added a .hidden class to the 'results-per-page' table row right in the plugin file :(

    Thank you, awesome plugin.

  8. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    That definitely works. The next version should make things a bit better.

    Do consider leaving a good review :)

  9. franciscus
    Member
    Posted 1 year ago #

    I have a similar issue: I'd like to remove the relevance score and the date.
    I know I can do that by hiding them through css, but it would be great if I could define a custom template for the individual result, rather than having to edit the get_bsearch_results function.

    But don't misunderstand this, I love this plugin and I'll try to tweak it to make it do what I need. Thanks!

  10. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Have you tried the Seamless Integration option? It will fit directly within your theme

  11. franciscus
    Member
    Posted 1 year ago #

    Yes, that's what I ended up doing. Works beautifully.

  12. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you :)
    It's going to be the default option in future plugin versions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic

Tags