Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to insert short codes under topic pages?

Viewing 13 replies - 1 through 13 (of 13 total)
  • @robin-w

    Moderator

    do you mean after the main forum page, or each forum page, or each topic page ?

    @truth4vahid

    Participant

    I mean each topic page

    @robin-w

    Moderator

    and then same shortcode on every topic page, and above or below the reply form ?

    @truth4vahid

    Participant

    Yeah, on every topic page and above the reply form

    @robin-w

    Moderator

    sorry, this one slipped by

    add this code, changing ‘shortcode here’ to the actual shortcode you wish to execeute

    add_action( 'bbp_theme_before_reply_form' , 'rew_add_shortcode'); 
    
    function rew_add_shortcode () {
    	echo do_shortcode( '[shortcode here]' );
    }

    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

    @truth4vahid

    Participant

    Thanks Robin, it works! You’re amazing!

    @truth4vahid

    Participant

    I want put a html code under the reply form like the area shown in the picture. Could you give me such a code?
    area

    @robin-w

    Moderator
    add_action( 'bbp_template_after_single_topic' , 'rew_add_shortcode2'); 
    
    function rew_add_shortcode2 () {
    	echo do_shortcode( '[shortcode here]' );
    }

    @truth4vahid

    Participant

    Great job! Thank you Robin.

    @truth4vahid

    Participant

    Could you give me another code to put shortcode in this area under lables:
    shortcode 1

    @robin-w

    Moderator
    add_action( 'bbp_template_before_topics_loop' , 'rew_add_shortcode3'); 
    
    function rew_add_shortcode3 () {
    	echo do_shortcode( '[shortcode here]' );
    }

    @truth4vahid

    Participant

    Far out! Thank you dear Robin.

    @robin-w

    Moderator

    no problem !

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