Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add search bar?


  • zoddshop63
    Participant

    @zoddshop63

    How to add search bar on top of page for forums and topics? It only shows up on the index. There was a plugin called bbptools that did it, but it was outdated and caused critical errors so i had to delete it.

Viewing 2 replies - 1 through 2 (of 2 total)

  • Robin W
    Moderator

    @robin-w

    function bbptoolkit_show_search_form(){
    	if ( bbp_allow_search()) {
    			?>
    			<div class="bbp-search-form">
    				<?php bbp_get_template_part( 'form', 'search' ); ?>
    			</div>
    			<?php
    		}
    	}
    	
    add_action( 'bbp_template_before_single_forum', 'bbptoolkit_show_search_form' );
    add_action( 'bbp_template_before_single_topic', 'bbptoolkit_show_search_form' );

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    zoddshop63
    Participant

    @zoddshop63

    it worked. your the best.

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