• I have several pages that are all part of the same topic, and I would like them to use the same comment thread on Disqus. I am using the following code to pull the custom identifier from a custom field:

    <?php
    //Attempt to get identifier
    $disqus = get_post_meta($post->ID, 'disqusid', true);
    //if isset & not blank else use $post->ID
    $disqus = (!empty($disqus)) ? $disqus : $post->ID;
    ?>
    <script type="text/javascript">
    var disqus_identifier = '<?=$disqus?>';
    </script>

    The code is displaying the value from the custom field correctly, however, Disqus is still using the page ID as the identifier when I inspect the page code. Meaning each page still uses its own comment thread.

    I have tried placing the code just before the comment_template call, inside the header.php, at the top of the page template, and in the footer.php file. None of them seem to make a difference.

    I’m not sure what else to try, and feel like I’m missing something simple. I appreciate any help!

    https://www.ads-software.com/extend/plugins/disqus-comment-system/

  • The topic ‘[Plugin: Disqus Comment System] Custom disqus_identifier not changing properly.’ is closed to new replies.