Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript What am I doing wrong with this Lazy load script?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #203464
    lvvvvvl
    Participant

    Hello,

    I’m trying to load Disqus lazily on my Genesis framework powered wordpress installation using javascript I found on a website which I’ve tried inserting in my header and footer afterwards:

    http://codepen.io/anon/pen/doWaER

    Then I used the Genesis hooks and add it to my functions.php:

    /*** Disqus Comment for Genesis Framework ***/
    remove_action( 'genesis_comments', 'genesis_do_comments' );
    add_action('genesis_comments', 'wpa_disqus_comments' );
    function wpa_disqus_comments() {
    if ( is_single() ) {
    ?>
    <div class="comments"></div>
    <?php }
    }

    After modifying my Disqus shortname in the javascript I get a blank comment section. I modified the <div class to random text to see if it appeared and it does so I suspect it’s something to do with the way I’m implementing the javascript. Any suggestions as to what I’m doing wrong?

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.