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

    @robin-w

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


    truth4vahid
    Participant

    @truth4vahid

    I mean each topic page


    Robin W
    Moderator

    @robin-w

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


    truth4vahid
    Participant

    @truth4vahid

    Yeah, on every topic page and above the reply form


    Robin W
    Moderator

    @robin-w

    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

    @truth4vahid

    Thanks Robin, it works! You’re amazing!


    truth4vahid
    Participant

    @truth4vahid

    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

    @robin-w

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

    truth4vahid
    Participant

    @truth4vahid

    Great job! Thank you Robin.


    truth4vahid
    Participant

    @truth4vahid

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


    Robin W
    Moderator

    @robin-w

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

    truth4vahid
    Participant

    @truth4vahid

    Far out! Thank you dear Robin.


    Robin W
    Moderator

    @robin-w

    no problem !

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