Guys, I am still confuse
My function.php code
function theme_js()
{
wp_enqueue_script(‘min_js’, get_template_directory_uri() . ‘/js/jquery.min.js’, array(‘jquery’), ”, true);
wp_enqueue_script(‘cycle_js’, get_template_directory_uri() . ‘/js/slider/jquery.cycle.all.js’, array(‘jquery’), ”, true);
wp_enqueue_script(‘chilli_js’, get_template_directory_uri() . ‘/js/slider/chili-1.7.pack.js’, array(‘jquery’), ”, true);
}
add_action(‘wp_enqueue_scripts’, ‘theme_js’);
My original header.php code
<script type=”text/javascript” src=”js/jquery.min.js”></script>
<script type=”text/javascript” src=”js/slider/jquery.cycle.all.js”></script>
<script type=”text/javascript” src=”js/slider/chili-1.7.pack.js”></script>
<script type=”text/javascript”>
$(function() {
$(‘#slideshow’).cycle({ slideExpr: ‘img’ });
$(‘#zoom’).cycle({
fx: ‘zoom’,
sync: false,
delay: -2000
});
$(‘#slide’).cycle({
fx: ‘turnDown’,
delay: -4000
});
$(‘#up’).cycle({
fx: ‘curtainX’,
sync: false,
delay: -2000
});
});
</script>
When i delete the above code in header.php the js won’t work.
So i modified the code in header.php and deleted the function.php code
Modified header.php code
<script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() . ‘/js/jquery.min.js’ ?>”></script>
<script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() . ‘/js/slider/jquery.cycle.all.js’ ?>”></script>
<script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() .’/js/slider/chili-1.7.pack.js’ ?>”></script>
<script type=”text/javascript”>
$(function() {
$(‘#slideshow’).cycle({ slideExpr: ‘img’ });
$(‘#zoom’).cycle({
fx: ‘zoom’,
sync: false,
delay: -2000
});
$(‘#slide’).cycle({
fx: ‘turnDown’,
delay: -4000
});
$(‘#up’).cycle({
fx: ‘curtainX’,
sync: false,
delay: -2000
});
});
</script>
<?php wp_head(); ?>
</head>
This works fine. But i want to only code in function.php and remove the js link in header.php
Can u guys can help me??
and one more thing…
<script type=”text/javascript”>
$(function() {
$(‘#slideshow’).cycle({ slideExpr: ‘img’ });
$(‘#zoom’).cycle({
fx: ‘zoom’,
sync: false,
delay: -2000
});
$(‘#slide’).cycle({
fx: ‘turnDown’,
delay: -4000
});
$(‘#up’).cycle({
fx: ‘curtainX’,
sync: false,
delay: -2000
});
});
</script>
The above code is used for sliding the image… what should be done to this code.. Currently I am using this code in header.php