Support » Plugin: Comments - wpDiscuz » Shortcode for wpdiscuz

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi @samtulana,

    Thank you for using wpDiscuz and for contacting us.

    You can use this shortcode:

    function my_wpdiscuz_shortcode() {
      if (file_exists(ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php')) {
          ob_start();
          include_once ABSPATH . 'wp-content/plugins/wpdiscuz/templates/comment/comment-form.php';
          return ob_get_clean();
      }
    }
    add_shortcode('wpdiscuz_comments', 'my_wpdiscuz_shortcode');

    Personally, I just tried. It does not work.
    I want to integrate the code with the theme of the extension “WPMobile.app”.

    • This reply was modified 7 months, 1 week ago by kevin091291.

    I tried this too …
    I assume that the code above needs to be added to the functions.php file

    but what is the shortcode that i use

    i have tried [wpdiscuz_comments] and [my_wpdiscuz] and [my_wpdiscuz_shortcode]

    please update urgently!!!

    samtulana

    (@samtulana)

    Please implement the shortcode. It is very convenient and now relevant. Thank you for your work.

    Plugin Support gVectors Support

    (@gvectorssupport)

    Hi @zubo2, @samtulana,

    You should use the shortcode below in post content:

    [wpdiscuz_comments]

    If you need to use shortcode in theme files add it with do_shortcode function:

    
    <?php
    echo do_shortcode("[wpdiscuz_comments]");
    ?>
    
    zubo2

    (@zubo2)

    thanks… works well

    The shortcode works, but I have a question/problem…. I am trying to add multiple comment boxes under one page. Only one is showing though. The others are not. How do I get the others to display?

    Plugin Author gVectors Team

    (@gvectors-team)

    Hi @geenow1085,
    I’m, sorry but wpDiscuz is can only be loaded on a single post/page, it can’t work on archive pages like Categories, Tags, Author, Search, etc… wpDiscuz is based on AJAX and JS functions so they make conflict if there are more then one comment form. The Comment System of WordPress is also designed for single pages, it uses current single post/page ID for all functions so mixing lots of posts on non-singular page stops comment form working functions.

    Aw ok. Is there a workaround? I would pay you guys to do it? I’m thinking it can be done through Iframe or something? Also, Facebook comment plugin you can do it by referencing the url attachment page and you can use multiple comment boxes in that one page. I don’t like facebooks plugin though I love yours and I really want to use it!!

    Plugin Author gVectors Team

    (@gvectors-team)

    I’m really sorry but we don’t have any workaround for this. Facebook and other comment plugins load their comment system in iframes from 3rd party servers so they can load it many times. But wpDiscuz is a WordPress integrated plugin, it’s loaded with your WP page content.

    Hello

    where should I add this code?

    <?php
    echo do_shortcode(“[wpdiscuz_comments]”);
    ?>

    Plugin Author gVectors Team

    (@gvectors-team)

    Hi @bakhshi,
    First please let me know why you want to use wpDiscuz shortcode. wpDiscuz should be loaded on your posts automatically, you should not use shortcode in post content. Please read this documentation and fix the issue in case the wpDiscuz comment form is missing: https://wpdiscuz.com/docs/wpdiscuz-documentation/getting-started/missing-comment-form/

    I use Elementor/Elementor Pro to create pages/lessons in Learndash. I use two columns. The comment box and the comments should only be in one column. Is this possible? Can it be achieved with a shortcode? What do I have to do?

    i have a best slotion for this.if you want multiple comment boxes of wp-discuz on one page so copy this short code with given hook in functions.php it will work on all pages.

    function my_wpdiscuz_shortcode() {
    if (file_exists(ABSPATH . ‘wp-content/plugins/wpdiscuz/templates/comment/comment-form.php’)) {
    ob_start();
    include_once ABSPATH . ‘wp-content/plugins/wpdiscuz/templates/comment/comment-form.php’;
    return ob_get_clean();
    }
    }
    add_shortcode(‘wpdiscuz_comments’, ‘my_wpdiscuz_shortcode’);

    add_action(‘jnews_single_post_end’,’discuzz’);
    function discuzz()
    {

    echo do_shortcode(“[wpdiscuz_comments]”);

    }

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