I have the following script:
$(document).ready(function() {
$('#slideSelect').change(function(){
$('#slideViewer img').attr('src', $(this).val() + '.png');
});
});
I’d like to know how the best way to add a WordPress Template Tag is to the #slideViewer img section.
The template tag is:
<?php bloginfo('template_directory); ?>/builderimages/
Basically I want to end with:
$('#slideViewer img').attr('src', TEMPLATE TAG HERE + $(this.val() + '.png');
You could try this:
This should work as long as the file with the
var IMG_DIRpart is being processed by PHP/WordPress. If necessary, you could put that in a<script>in your template’s<head>section so that it will be visible everywhere.