Hello all, I want to load a jQuery script to one of my pages in wordpress without it loading on all the pages. When I register and enqueue the script in my functions.js file it loads up on all my pages.
Thank you for your help : )
Hello all, I want to load a jQuery script to one of my pages in wordpress without it loading on all the pages. When I register and enqueue the script in my functions.js file it loads up on all my pages.
Thank you for your help : )
Enqueue the script via a function and then only add the filter to wp_head based on an is_page() conditional.
Hello esmi, this is my code but it's still not loading?
<?php wp_head(); ?>
<?php if (is_page('home')) { ?>
<script src="<?php bloginfo('template_url'); ?>/js/load.js"></script>
<script src="<?php bloginfo('template_url'); ?>/js/jquery.flexslider.js"></script>
<?php } ?>
</head>Thank you esmi this helped : )
You must log in to post.