Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Scripts not enqueued in post archives #34

Open
nickcernis opened this issue Oct 4, 2017 · 1 comment
Open

Scripts not enqueued in post archives #34

nickcernis opened this issue Oct 4, 2017 · 1 comment

Comments

@nickcernis
Copy link
Contributor

Required JS is not enqueued on archives, so clicking FAQs has no effect on the Blog template, for example.

@nickcernis
Copy link
Contributor Author

nickcernis commented Nov 30, 2018

People are also using the shortcode outside of the loop: https://wordpress.org/support/topic/toggle-not-working-outside-loop/

We could revisit script loading logic to weigh the usability of having scripts load more broadly against the performance implications:

public function load_dependencies() {
if ( ! is_singular() ) {
return;
}
global $post;
$content = $post->post_content;
// Load assets if in post content.
if ( has_shortcode( $content, 'gs_faq' ) ) {
Genesis_Simple_FAQ()->assets->enqueue_scripts();
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant