Skip to:
Content
Pages
Categories
Search
Top
Bottom

create a un function


  • frenchlemans
    Participant

    @frenchlemans

    Hi,

    I would like create a <div> with class in <?php bbp_reply_content(); ?> in bbpress/loop-single-reply.php but I can’t find where is the function bbp_reply_content()

    Not knowing php, is there someone to help me ?

    Thank you very much

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

  • Robin W
    Moderator

    @robin-w

    so if you currently have

    <div class="bbp-reply-content">
    
    This is the content
    
    </div>

    what do you want it to look like ?


    frenchlemans
    Participant

    @frenchlemans

    Hello Robin,

    Thank you for your quick reply.

    But that’s not what I want.
    In the <? Php function bbp_reply_content (); ?>
    There is the text written by the members. I would like to create a <div> space with independent class inside the writing space.
    I have already done what you suggest but it creates a div outside of <? Php bbp_reply_content (); ?>

    Regards


    Robin W
    Moderator

    @robin-w

    the above was a question – what do you want it to look like? I was trying to help you, but you’ll find the function in

    includes/replies/templates it has a filter you can use.


    frenchlemans
    Participant

    @frenchlemans

    Sorry I am French and my English can be improved.

    I went to see where you say, I can see the function well but the problem is that I don’t know how to create a div with class at all.

    which is the subject of my request.

    Regards


    Robin W
    Moderator

    @robin-w

    ok, let us try and get to what you want.

    so if the content of a reply was ‘hello how are you ?’

    then at the moment bbpress would show

    <div class="bbp-reply-content">
    hello how are you ?
    </div>

    what would you like it to show?


    frenchlemans
    Participant

    @frenchlemans

    Thank’s,
    I would like that :

    <div class=”bbp-reply-content”>
    <p>hello how are you ?</p>
    <div class=”frenchlemans”>
    I’m superman
    </div>
    </div>


    Robin W
    Moderator

    @robin-w

    ok, will I’m superman be the same everytime ?


    frenchlemans
    Participant

    @frenchlemans

    no it will be a <div> to create a space with a min-height set in the CSS class.


    Robin W
    Moderator

    @robin-w

    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

    add_filter( 'bbp_get_reply_content', 'rew_add_class' , 10 , 2) ;
    
    function rew_add_class ($content, $reply_id ) {
    	$content.='<div class="frenchlemans">Iā€™m superman</div>' ;
    return $content;
    }

    frenchlemans
    Participant

    @frenchlemans

    WAhoooo Robiiiin !!

    So good, there is 5 days i’m looking for
    You are the best of the best !!

    screen shot

    Thank you very much !!
    Regards
    Bernard


    Robin W
    Moderator

    @robin-w

    Great – glad you are fixed !! šŸ™‚

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