page template jquery slideshow
-
I’m pretty new so may be going about this all wrong. I’m attempting to read in files from an image folder for a slideshow. Gets hung up after <div id=”myslides”>. Here’s the page. I have added
<?php wp_enqueue_script("jquery"); ?>
to header.php just before<?php wp_head(); ?>
. Maybe I’m not allowed to call the jquery function or scripts from within the template and if not where do I put them? Trying to modify theme files as little as possible. All tips are welcome as I am learning. Here’s the latest version of my code:<?php /* Template Name: Custom Interior Page */ list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options(); get_header(); extract($bfa_ata); global $bfa_ata_postcount; ?> <script type="text/javascript"> var $j = jQuery.noConflict(); $j($(document).ready(function(){ $j($('#myslides').cycle({ fit: 1, pause: 1, timeout: 4000 })); })); </script> <style> #myslides { height:400px; width:600px; } </style> <div id="interior_wrapper"> <?php global $post; $post_slug=$post->post_name; $img_directory = '../../images/'.$post_slug; // echo $directory; // Styling for images echo '<div id="myslides">'; foreach ( new DirectoryIterator($img_directory) as $item ) { if ($item->isFile()) { $path = $img_directory . '/' . $item; echo '<img src="' . $path . '"/>'; } } echo '</div>'; ?> </div> <script src="../../scripts/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="../../scripts/jquery.cycle.lite.js" type="text/javascript"></script> <?php get_footer(); ?>
[Please use the code buttons when posting code ]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘page template jquery slideshow’ is closed to new replies.