• Resolved shaktal

    (@shaktal)


    I’m trying to get the comment-reply script to load on my site for my blog posts.

    I have the following in my header.php file:

    <?php if( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } ?>
    <?php wp_head(); ?>

    However, when using view-source: there is no trace of the comment-reply.js file that I would expect.

    Does anyone have any ideas how I can get this to be loaded?

    My site url is https://www.thomas-russell.co.uk if it helps,

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • If I go to your blog, I can see “comment-reply.min.js” is being loaded. Check this screenshot.

    Is this the JS file you want?

    There are three conditions that must be met for that script to be enqueued, right?

    1. You’re on a single Post page (is_singular())
    2. Comments are open (comments_open())
    3. You have Threaded Comments enabled (get_option( ‘thread_comments’ ))

    When you check if your JS is loading, don’t check view-source: but rather, right-click, Inspect Element and then check out the Sources tab for your JS.

    Does that help or am I missing something?

    Thread Starter shaktal

    (@shaktal)

    Oh right, I couldn’t find it in the view-source: so I assumed that it wasn’t being loaded, I didn’t realize that the Sources tab was the better way to check for it.

    Thank you very much for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting comment-reply script to be loaded’ is closed to new replies.