Tagged: ,

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #174436

    Is there a shortcode to add a disqus comments section to a page?

    I want to add it to a page I make available only to certain users. This is for a page and NOT a post.

    Thanks!

    #174508

    Hey Alex!

    Take a look at this, scroll down to “Integrating Disqus Into WordPress Without a Plugin”

    http://wp.tutsplus.com/tutorials/plugins/integrating-disqus-into-wordpress/

    Regards,
    Josue

    #174591

    I don’t understand this very well.
    I went into my functions.php file in the /wp-content/themes/enfold-child/ folder and added:

    function disqus_embed($disqus_shortname) {
    global $post;
    wp_enqueue_script(‘disqus_embed’,’http://’.$disqus_shortname.’.disqus.com/embed.js’);
    echo ‘<div id=”disqus_thread”></div>
    <script type=”text/javascript”>
    var disqus_shortname = “‘.$disqus_shortname.’”;
    var disqus_title = “‘.$post->post_title.’”;
    var disqus_url = “‘.get_permalink($post->ID).’”;
    var disqus_identifier = “‘.$disqus_shortname.’-’.$post->ID.’”;
    </script>’;
    }

    Then I edited my page (not a blog page, not a post, just a regular page that I want to add comments on) and added a text block with the following code:

    <div id=”disqus_thread”></div>
    <!–?php disqus_embed(‘myexampleblog’); ?–>

    And it still doesn’t load on that page. What am I doing wrong?

    #174841

    Hey!

    You have to edit the page.php file located in the Theme directory, then add this code and change ‘myexampleblog’ by the real name of your site registered in Disqus:

    <div id=”disqus_thread”>
    <?php disqus_embed(‘myexampleblog’); ?>
    </div>

    Regards,
    Josue

    #174871

    That didn’t work. I added this to the bottom of page.php in my enfold theme folder (the child folder had no page.php file):

    <div id=”disqus_thread”>
    <?php disqus_embed(homesmartsecure.disqus.com); ?>
    </div>

    And I added this to the bottom of function.php in my enfold CHILD theme folder:

    function disqus_embed($disqus_shortname) {
    global $post;
    wp_enqueue_script(‘disqus_embed’,’http://homesmartsecure.disqus.com/embed.js’);
    echo ‘<div id=”disqus_thread”></div>
    <script type=”text/javascript”>
    var disqus_shortname = “‘.$disqus_shortname.’”;
    var disqus_title = “‘.$post->post_title.’”;
    var disqus_url = “‘.get_permalink($post->ID).’”;
    var disqus_identifier = “‘.$disqus_shortname.’-’.$post->ID.’”;
    </script>’;
    }

    I only want the comments on this one page, NOT all my pages, but I can’t get it to show up at all on anything but a blog post and I don’t have to do anything for that.

    If I can’t add disqus comments to this page (which I really want to do), can I at least add the theme’s comments to this one page somehow, not all of them?

    #174876
    This reply has been marked as private.
    #174884

    Do you want an admin account to my wordpress or should I make one for ftp as well?

    #174886

    An administrator WordPress account will be fine.

    Best regards,
    Josue

    #174893
    This reply has been marked as private.
    #174894
    This reply has been marked as private.
    #174901
    This reply has been marked as private.
    #174921
    This reply has been marked as private.
    #174922

    Can you please let me know what you do so I can learn from it? Thanks for all your help.

    #175182
    This reply has been marked as private.
    #175221

    Awesome, thanks. I have to go over the code to learn why this works and why what I was doing wasn’t working.

    It’s great!

    #175224
    This reply has been marked as private.
    #175269

    So then the code I posted in functions.php is unnecessary and all we need is the page-disqus.php file? I noticed the plugin was disabled. So that was also unnecessary as well?

    Either way, it works and I’m loving’ it!

    Thanks man!

    #175373

    Hi!

    Yes, the code in functions.php it’s unnecessary. The Plugin too, unless you want to use Disqus for Posts.

    Cheers!
    Josue

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘Add Disqus comments to any page’ is closed to new replies.