Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding search bars to topics


  • arrangedletters
    Participant

    @arrangedletters

    Hi there,

    I was wondering if there was a way to add a search bar to the top of a topic? There’s only one displayed on the forums main page but I can’t seem to find away to make it appear at the top of specific topics.

    Hopefully I’ve been clear enough… If not let me know!

    Any help would be greatly appreciated!

    Cheers

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

  • Robkk
    Moderator

    @robkk


    arrangedletters
    Participant

    @arrangedletters

    I tried adding that to my functions and all it succeeded in doing was breaking the website!

    Granted that is more than likely down to my lack of knowledge!


    Robkk
    Moderator

    @robkk

    @arrangedletters

    you did put it in your child themes functions.php file or a functionality plugin like this right??..

    https://wordpress.org/plugins/functionality/

    and how did it break your site??


    arrangedletters
    Participant

    @arrangedletters

    Yes, I put it in the functions.php

    When I then went to reload the website all it would return was a blank white page.

    I then restored the previous code via ftp and the website displayed correctly once more.

    Edit: I’ll try that functionality plugin and see if it works there – I’m a bit new to this so there’s a strong chance I did it wrong!

    function rk_bbp_search_form(){

    if ( bbp_allow_search()) {
    ?>
    <div class=”bbp-search-form”>

    <?php bbp_get_template_part( ‘form’, ‘search’ ); ?>

    </div>
    <?php <–right here it opens a tag without closing it though, doesn’t it?
    }
    }

    add_action( ‘bbp_template_before_single_forum’, ‘rk_bbp_search_form’ );
    add_action( ‘bbp_template_before_single_topic’, ‘rk_bbp_search_form’ );
    add_action( ‘bbp_template_before_search’, ‘rk_bbp_search_form’ );


    Robkk
    Moderator

    @robkk

    is there any other code in your functions.php in your child theme??

    usually there is a <?php on the first line if you created a functions.php in your child theme. then you can put your custom functions in that.

    and to use the functionality plugin you install , activate , then go to plugins > edit functions
    then place any code snippet you get from sites and place it into there after the plugin information.

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