Good Day Everyone. I'm using FoundationPress as frontend and Wordpress as backend. I created a very simple plugin to upload image into the homepage. I've no issue with that. I can display them properly in the page I desired. However I wish to use little bit of javascript for the image slideshow.
However I've no clue on where on earth to locate my javascript files. I also noticed that I can't even find a single .js files in Foundationpress header or footer. I did some search but I cant comprehend any. Below are my script. Please somebody help me on this.Thanks a million.
I need to locate this in header:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
This one probably before </body> tag:
<script src="js/jquery.krakatoa.js"></script> <script>
$(window).on('load',function(){
$('.krakatoa').krakatoa( {
width: '1100px',
height: '320',
autoplay: true,
loop: true,
delay: 9000, //Slider on hold for 9 sec
duration: 800, //Slider Transition Timer
direction: -1,
first: 9});
});
</script
This is how I display image retrieved from database:
<div class="row"> <div class="large-12 columns"> <div class="krakatoa">//'krakatoa' is the class responsible for slideshow animation
<?php
global $wpdb;
$tablename="tbl_banner";
$retreive_data=$wpdb->get_results("SELECT * FROM $tablename");
$upload_dir = wp_upload_dir();
foreach($retreive_data as $data)
{
?> <img src="<?php echo $upload_dir['baseurl']."/2014/12/".$data->image_name; ?>"> </div> <?php
}
?> </div> </div>