Skip to:
Content
Pages
Categories
Search
Top
Bottom

Text under comment box on BuddyPress Default theme

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @words2us add the following to your child theme’s functions.php file

    `add_filter( ‘comment_form_defaults’, ‘mme_remove_default_html’);

    function mme_remove_default_html ( $default ) {
    unset($default);
    return $default;
    }`

    Avatar of words2us
    words2us
    Member

    @words2us

    Thanks, @mercime but unless I’m mistaken, that will remove the text below the comment form. I want to be able to modify the text there.

    Avatar of funmi omoba
    funmi omoba
    Participant

    @funmi-omoba

    @words2us, this is off topic but please which font are using for your logo or better still who did your logo?

    Regard

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @words2us strikethrough the text did give the impression that you wanted to delete the HTML tags. If you want to change the text, add the following instead to your theme’s functions.php file

    `add_filter( ‘comment_form_defaults’, ‘mme_change_default_html’);

    function mme_change_default_html ( $default ) {
    $default = ‘

    Check out BuddyPress.

    ‘;
    return $default;
    }`

    Avatar of LoeC
    LoeC
    Participant

    @loec

    @mercime I tried adding the above code to functions.php (changing “Check out BuddyPress” to my own text) and it didn’t work. I just added it at the end and it appeared at the top of every page on the site. I am a novice at this. Is there someplace else I was supposed to put this? I realize BuddyPress has been upgraded since this thread was started and I have the latest version. Any help would be appreciated. Thanks!

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    Hi,

    @mercime, your code gives a warning about array merge.

    Tthe blog comment form is not BP dependant, but is WP stuff. So you can use a WP filter in this case.

    Insert theĀ  code below into the child theme functions.php (not bp-default functions.php because you will loose your change at the next BP update)

    <code>add_filter( ‘comment_form_after’, ‘blabla’ );
    function blabla () { ?>
    your text here !
    <?php
    }</code>

    Avatar of LoeC
    LoeC
    Participant

    @loec

    @chouf1 and @mercime, thanks for your replies, but I think I need more specific instructions. In both cases I put the code at the bottom of the functions.php file and in both cases my site went totally blank. Where/how do I add the filter.

    @chouf1, does my text need single quotes?

    Thanks so much for your patience.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    <cite>does my text need single quotes?</cite>no ! The text is outside the php part.

    But you have to modify the quotes to single quotes when you copy/paste from here. Simply see how other code is written in the file.

    If your site went blankĀ  it’s because you leave a empty line at the end of the functions.php probably.

    If you paste my code at the end of the file, } must be the last line of it.

    FYI functions.php doesn’t close with ?> as usual php files.

    You must also use a text editor as notepad (and save as text – ANSI without BOM) or better notepad++ to edit php files, but never Word or something like this. Or at least the WP file editor….

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

You must be logged in to reply to this topic.