Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

On pages that have the comments activated an additional JS file is ne… #488

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions library/enqueue-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ function foundationpress_scripts() {
// It's a good idea to do this, performance-wise. No need to load everything if you're just going to use the grid anyway, you know :)
wp_enqueue_script( 'foundation', get_template_directory_uri() . '/assets/javascript/foundation.js', array('jquery'), '5.5.2', true );

// Add the comment-reply library on pages where it is necessary
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

}

add_action( 'wp_enqueue_scripts', 'foundationpress_scripts' );
Expand Down