I’ve this code in a fille called: general.js
if($('#showcase').length) {
$.include('js/jquery.aw-showcase.js');
}
But as we all know, WordPress uses bloginfo('template_url')
to path files.
In front-end not work because show incorrect path <script type="text-javascript" src="js/jquery.aw-showcase.js"></script>
How to solve it?
Maybe not the best solution, but you could always declare a JS variable early in your main index file, like such:
Now, in your general.js file, you can reference it as such:
You should usually avoid using a global variable, but it might be the only solution in this case.
EDIT: You might actually want to use wp_localize_script instead of declaring a global variable.
At least, could you not try this ?