Plugin Contributor
ryanv12
(@ryanv12)
If you’re trying to customize the way threads load on certain pages, you might consider disabling comments for that page (which also disables Disqus), and implementing our universal code:
https://help.disqus.com/customer/portal/articles/472097
That should give you complete control over the variables passed to the embed.
Thread Starter
9ery
(@9ery)
Hello,
first, thank you for your help. I did what you said first, disabling comments and adding the following code in the .php for my posts :
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'myshortname'; // Required - Replace example with your forum shortname
var disqus_identifier = '<?php echo get_post_meta($post->ID, 'dis_ident_field', true); ?>';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
So I am able to set dis_ident_field in the custom fields of wordpress.
But for some reason, it doesn’t show the thread I want. So I am doing a mistake somewhere, but I’m not sure where:
– Am I using the right ID for the thread while defining dis_ident_field ?
– Is it the one we find in the admin/moderate section in disqus when I select the thread like : thread:xxxxxxxxx?
– Am I stupid? 🙂
Hi 🙂
Did you find a solution to this problem? I don’t know how to do it either… ;(
And ryanv12 when you say “implementing our universal code” do you mean that we won’t be able to login via our wordpress website anymore because this code doesnt use the plugin?
thank you very much