I’m using the wordpress plugin.
I’ve found the code in the plugin file “comments.php” that defines the identifier for a page:
var disqus_identifier = '<?php echo dsq_identifier_for_post($post); ?>';
What I’ve come up with so far is to replace it with:
var disqus_identifier = '<?php echo get_post_meta($post->ID, 'dis_ident_field', true); ?>';
This means that it will get it’s disqus_identifier from a custom field from WordPress called dis_ident_field, but I’m worried about this method. For pages where I don’t populate this field, I now have no identifier at all in the javascript in the page source.
Can someone explain why having no id is bad, because the comments still work on all those pages properly, so it’s getting an id from somewhere.
You could use something like this to check if its set before using it or set it to the page id.