Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function enqueue_assets() {
- if (!is_singular()) {
- return;
- }
- $content = get_post_field('post_content', get_the_ID());
- if (!has_shortcode($content, 'shortcode_name_here')) {
- return;
- }
- wp_enqueue_script('contact_js', get_template_directory_uri() . '/assets/js/contact.js', array(), '1.1', true);
- }
- add_action('wp_enqueue_scripts', 'enqueue_assets');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement