Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add content under threads?


  • Skrollen
    Participant

    @skrollen

    Hi,
    I would like to add some content underneath every forum topic. So that when a user scrolls down through the discussion, when it ends they see this content. What would be the best way to go about this?

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

  • Robin W
    Moderator

    @robin-w

    If it is just one line then add the following to your functions file

    function my_content () {
    	$content = 'Hello this is some content after the topic' ; 
    	echo $content ;
    	}
    	 
    add_action ('bbp_template_after_replies_loop', 'my_content' ) ;

    and change the text to what you want

    Functions files and child themes – explained !

    If it is more than that, then you will need to detail exactly what you want so I can help you.


    Skrollen
    Participant

    @skrollen

    Cool, thanks!

    If possible I would like to add a bit more than just a line of content. Like a paragraph of text (like 50 Words) and an image or two. Is there any way to do this through code, or perhaps by being able to insert a text widget?


    Robin W
    Moderator

    @robin-w

    no it can be done by this

    so

    create a post (you’ll delete this after, this is just temporary) and put what you want in the content, including nay images, and get it looking like you want it. you can’t have any single quotes (‘) but can have double quotes (“).

    Then switch to ‘text’ view – top right of the content box. This will take you into html mode, and the ‘code’ we need will be there.

    Copy all this code into the $content = bit in the code above. It must have a ‘ at either end, and a ; at the end so you will end up with

    $content = ‘ whatever the text you copied is in here ‘ ;

    then save and upload, and delete the post when you are happy it works.

    Come back if any of that doesn’t work, and if you do and are happy to make it public let me know what you have pasted in there so I can make sure it’s right


    Skrollen
    Participant

    @skrollen

    Awesome tip, will try this. Thanks a lot for your help!

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