bigcobi wrote:bigcobi wrote:extatix wrote:Actually, this is the complete code to do it:
function kill_js() {
wp_deregister_script( 'jquery-cycle' );
}
add_action( 'wp_print_scripts', 'kill_js', 100 );
function my_slideshow_js() {
if (is_home() || is_front_page() ) {
wp_enqueue_script('jquery-cycle-all', get_stylesheet_directory_uri() . '/js/jquery.cycle.all.js', 'jquery', null, true);
}
}
add_action('wp_print_scripts', 'my_slideshow_js');
function my_add_slideshow_js() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
<?php if (is_home() || is_front_page()) : ?>
$('#featured-slideshow').cycle({
fx: 'wipe',
speed: 250,
next: '#controls .next',
prev: '#controls .prev',
timeout: 6000,
pause: 1,
slideExpr: '.featured-slideshow-inner',
height: '<?php $size = arras_get_image_size('featured-slideshow-thumb'); echo $size['h']; ?>px'
});
<?php endif ?>
});
</script>
<?php
}
add_action('wp_footer', 'my_add_slideshow_js');
function my_slideshow_init() {
remove_action('arras_footer', 'arras_add_slideshow_js');
}
add_action('init', 'my_slideshow_init');
You can change the 'fx: 'wipe',' into anything from here: http://jquery.malsup.com/cycle/browser.html
using a child theme I put this where?
Parse error: syntax error, unexpected '}' in /nfs/c05/h03/mnt/3813/domains/theflowlive.com/html/wp-content/themes/nullcoreII/functions.php on line 80
this is my error
<?php
if (is_admin() && isset($_GET['activated']) && $pagenow == 'themes.php') {
$arras_options->style = 'default';
}
define( 'NULLCORE_DIR', STYLESHEETPATH );
define( 'NULLCORE_LIB', NULLCORE_DIR . '/library' );
load_child_theme_textdomain('nullcore', get_stylesheet_directory() . '/language');
require_once NULLCORE_LIB . '/tapestries.php';
require_once NULLCORE_LIB . '/custom.php';
require_once NULLCORE_LIB . '/nc-admin.php';
require_once NULLCORE_LIB . '/efca.php';
require_once NULLCORE_LIB . '/carousel.php';
require_once NULLCORE_LIB . '/sociallinks.php';
require_once NULLCORE_LIB . '/slider.php';
nullcore_flush_options();
add_action('init', 'nullcore_init');
add_action('arras_add_default_thumbnails', 'nullcore_thumbs', 15);
function nullcore_thumbs() {
arras_add_image_size( 'custom-node-thumb', __('Tapestry: Custom Node Based', 'arras'), 195, 110);
arras_add_image_size( 'custom-quick-thumb', __('Tapestry: Custom Quick Preview', 'arras'), 115, 115);
arras_add_image_size( 'custom-line-thumb', __('Tapestry: Custom Per Line', 'arras'), 36, 36);
arras_add_image_size( 'nc-carousel-thumb', __('Carousel', 'arras'), 150, 100 );
arras_add_image_size( 'slider-thumb', __('Slider', 'arras'), 195, 195 );
}
function kill_js() {
wp_deregister_script( 'jquery-cycle' );
}
add_action( 'wp_print_scripts', 'kill_js', 100 );
function my_slideshow_js() {
if (is_home() || is_front_page() ) {
wp_enqueue_script('jquery-cycle-all', get_stylesheet_directory_uri() . '/js/jquery.cycle.all.js', 'jquery', null, true);
}
}
add_action('wp_print_scripts', 'my_slideshow_js');
function my_add_slideshow_js() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
<?php if (is_home() || is_front_page()) : ?>
$('#featured-slideshow').cycle({
fx: 'wipe',
speed: 250,
next: '#controls .next',
prev: '#controls .prev',
timeout: 6000,
pause: 1,
slideExpr: '.featured-slideshow-inner',
height: '<?php $size = arras_get_image_size('featured-slideshow-thumb'); echo $size['h']; ?>px'
});
<?php endif ?>
});
</script>
<?php
}
add_action('wp_footer', 'my_add_slideshow_js');
function my_slideshow_init() {
remove_action('arras_footer', 'arras_add_slideshow_js');
}