Tagged: avia, disqus comments, enfold, pages, Visual Composer, wordpress
-
AuthorPosts
-
December 18, 2015 at 8:02 pm #555171December 18, 2015 at 9:54 pm #555227
Hey Jon!
thanks a lot for sharing your solution with us!!
Cheers!
AndyMay 11, 2016 at 1:34 pm #630692Thanks:)
May 12, 2016 at 6:56 am #631160December 19, 2017 at 5:32 am #890336I have noticed that this solution for Disqus is still working with the pages that I am using the Visual Composer editor for, but is no longer working for the pages which use the AVIA editor. I just started to convert all my my pages from to AVIA so I can ditch Visual Composer and noticed the issue.
Is there another change I should make to my Comments.php or PageLoop.php?December 20, 2017 at 2:45 pm #890776Hi millertimesites,
There is an error in JavaScript of the Disqus. How are you adding it?
Best regards,
VictoriaDecember 20, 2017 at 5:25 pm #890864Victoria,
The Null error on the Disqus Embed only seems to be showing up in the pages with the AVIA editor and works great on the other 230 pages of the site`
I have still been using the method listed above by replacing the contents of comments.php with the code above.
One tweak to the code above is to replace the s.src = ‘//EXAMPLE.disqus.com/embed.js’; with my own identifier supplied by Disqus (see private comments)Then in PageLoop.php I added
comments_template( ‘/includes/comments.php’);
right above:
echo ‘<footer class=”entry-footer”>’;December 20, 2017 at 6:16 pm #890893Hi millertimesites,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaDecember 20, 2017 at 7:48 pm #890912here you go, my PHP edits are on the parent theme as I have been weary of overriding the parent PageLoop.php in the Child Theme
December 21, 2017 at 7:32 am #891034Victoria,
I had opened a ticket with Disqus also and they said that the code and set up was correct and that they believed it was likely an issue with the Enfold theme. To test I first disabled all plugins except Disqus however the comments still wouldn’t show up on pages using the AVIA editor. Once I switched from Enfold to the default WordPress theme of Twenty Seventeen however the Disqus comments showed up on every page with no problems.
Since using the Visual Composer plugin instead of AVIA lets the Disqus show up and disabling the theme also lets Disqus show up I am inclined to agree with them at it looks like a them/editor issue. I hope your team is able to find a solution as Disqus is the #1 comments plugin on WordPress. This is the last hurdle I have left for moving my popular travel blog over to Enfold as finding a solution for Disqus will allow me to finally ditch Visual Composer for AVIA.
Thanks again for looking into this!
JonDecember 21, 2017 at 5:35 pm #891223Hi millertimesites,
I see you trying to include the /includes/comments.php and the comments.php is not in the includes folder. So that does not look correct.
Best regards,
VictoriaDecember 21, 2017 at 8:03 pm #891328I switched the code in pageloop.php to have the correct file path but it didn’t make a difference
comments_template( ‘/comments.php’);Disqus comments are still working fine on pages using Visual Composer with the change
ex: https://www.bigboytravel.com/europe/austria/hallstatt/But are still not working on pages using Enfold’s Avia Editor
ex: https://www.bigboytravel.com/italy/siena/December 21, 2017 at 9:49 pm #891388Hi millertimesites,
It should be comments_template( ‘../comments.php’); since the comments.php is not in the same folder.
Best regards,
VictoriaJanuary 2, 2018 at 1:22 am #892410Think I figured it out, maybe?
I copied the contents of my custom comments.php shown above to my child theme
In that code I replaced the unique identifier and s.src = ‘//EXAMPLE.disqus.com/embed.js’; with the handle related to my Disqus account just like I did before.Then I added the code below to the parent theme’s template-builder.php file on line 59 (above the sidebar and footer call code) instead of putting it into the loop-page.php file
// Disqus comments_template( '/wp-content/themes/enfold-child/comments.php');
This seems to be working correctly on this page using Enfold’s AVIA Advanced Layout Builder for the editor
https://www.bigboytravel.com/europe/topmedievalcities/Did I do it right?
January 2, 2018 at 6:28 am #892427Hi,
Yes, if it’s loading and working properly then that means you did it right :)
Best regards,
NikkoFebruary 28, 2018 at 12:07 am #918737Update:
With the Newest theme update// Disqus comments_template( '/wp-content/themes/enfold-child/comments.php');
Must now go right above this inside template-builder.php (roughly line 102)
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
to make Disqus show up on static Pages when using the Enfold AVIA Editor.
If you are using Visual Composer instead of AVIA then you will follow the placement listed above inside of loop-page.php
loop-page.php can be found under the “includes” toggle while Template-builder.php is one of the main ones in the editorIf you have a mixture of pages with both editors for some reason you will have to do both methods
Jon
March 1, 2018 at 10:44 am #919524Hi,
@millertimesites: Thanks for the info. I’m sure it will help a lot of users. :)Best regards,
IsmaelApril 4, 2018 at 8:04 pm #937358Ismael and team,
In an effort to make this thread on Disqus even better I was wondering if you can help with On-Demand Loading.
Want to do this because Disqus sends 150-180 requests every time it is loaded on a page and really lags the full page render.
Even tried adding Disqus files to the PreLoad inside WP Engine but it still sends a million requests.I have seen a number of sites using Disqus that have a “Load Comments” button at the bottom and it does call Disqus until it is clicked.
One solution is on GitHub but I can’t seem to get it to work
https://gist.github.com/nternetinspired/7482445Currently, as mentioned above, I have this as my comments.php with my Disqus handle/shortname replacing EXAMPLE for the src
<?php if (comments_open()) : ?> <div id="disqus_thread"></div> <script> /** * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */ /* var disqus_config = function () { this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; */ (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//EXAMPLE.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <?php endif; // comments_open ?>
With that code, this is my call for placement
comments_template( '/includes/comments.php');
GitHub recommends this instead
$(document).ready(function() { $('.show-comments').on('click', function(){ var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username. // ajax request to load the disqus javascript $.ajax({ type: "GET", url: "http://" + disqus_shortname + ".disqus.com/embed.js", dataType: "script", cache: true }); // hide the button once comments load $(this).fadeOut(); }); });
It then mentions to use this but the button never opens
<!-- An element a visitor can click if they <3 comments! --> <button class="show-comments">Load Disqus comments</button> <!-- The empty element required for Disqus to loads comments into --> <div id="disqus_thread"></div>
April 5, 2018 at 11:56 pm #937947Hi,
That would actually require to add some div wrappers to elements at Disquss plugin and make it load based on those.
It is better to consider hire a freelancer to help you with that and maybe post the plugin back to the community.Thank you
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.