The theme I'm using on a website has the use of a Featured Post slideshow, which I had set up and working perfectly.
I now need to add a youtube gallery with the ability of opening in page with something like Shadowbox, Thickbox etc.
When I activate one of these plugins the Featured Image slide show on the homepage breaks and the images just sit one on top of the other.
I have read a few things on here regarding JQuery but I can't see any in the code for the Featured Slideshow.
Can anyone tell me why this is happening ?
Home Page Featured Image Code
<?php
if(get_theme_option('featured_posts') != '') {
?>
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
delay: 6000,
slideInfoZoneOpacity: 0.8,
showCarousel: false
});
}
window.addEvent('domready', startGallery);
</script>
<div class="fullbox_excerpt">
<div class="fullbox_content">
<div class="smooth_gallery">
<div id="myGallery">
<?php
$featured_posts_category = get_theme_option('featured_posts_category');
if($featured_posts_category != '' && $featured_posts_category != '0') {
global $post;
$featured_posts = get_posts("numberposts=5&&category=$featured_posts_category");
$i = 0;
foreach($featured_posts as $post) {
setup_postdata($post);
if ( version_compare( $wp_version, '2.9', '>=' ) ) {
$slide_image_full = get_the_post_thumbnail($post->ID,'large', array('class' => 'full'));
$slide_image_thumbnail = get_the_post_thumbnail($post->ID,'large', array('class' => 'thumbnail'));
} else {
$get_slide_image = get_post_meta($post->ID, 'featured', true);
$slide_image_full = "<img src=\"$get_slide_image\" class=\"full\" alt=\"\" />";
$slide_image_thumbnail = "<img src=\"$get_slide_image\" class=\"thumbnail\" alt=\"\" />";
}
?>
<div class="imageElement">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="open"></a>
<?php echo $slide_image_full; ?>
<?php echo $slide_image_thumbnail; ?>
</div>
<?php }
} else {
for($i = 1; $i <=5; $i++) {
?>
<div class="imageElement">
<h3>This is featured post <?php echo $i; ?> title</h3>
<p>To set your featured posts, please go to your theme options page in wp-admin. You can also disable featured posts slideshow if you don't wish to display them.</p>
<a href="#" title="This is featured post <?php echo $i; ?>" class="open"></a>
<img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="full" alt="" />
<img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="thumbnail" alt="" />
</div>
<?php
}
}
?>
</div>
</div>
</div>
</div>
<?php } ?>
Shadowbox code
<?php
/*
Plugin Name: Shadowbox
Plugin URI: http://ilbonzo.org
Description: Questo plugin integra in wordpress le funzionalità di shadowbox di Michael J. I. Jackson.
Author: Matteo Magni
Version: 0.2
Author URI: http://ilbonzo.org
*/
/* Copyright 2008 Matteo Magni (email: ilbonzo.org@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function shadowbox_init() {
$url = get_bloginfo('wpurl');
?>
<!-- WP shadowbox Plugin version 0.2 -->
<link rel="stylesheet" href="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/css/shadowbox.css" type="text/css" media="screen" />
<?php
/* ############################################### MOOTOOLS ########################################### */
?>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/lib/mootools.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/adapter/shadowbox-mootools.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/shadowbox.js"></script>
<script type="text/javascript">
window.onload = function(){
Shadowbox.init();
var flash_els = [
document.getElementById('flash1'),
document.getElementById('flash2'),
document.getElementById('flash3')
];
Shadowbox.setup(flash_els, {
gallery: 'Flash',
continuous: true,
counterType: 'skip'
});
};
</script>
<?php
/* ################################# PROTOTYPE #################################### */
/*
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/lib/prototype.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/lib/scriptaculous/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/adapter/shadowbox-prototype.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/shadowbox.js"></script>
<script type="text/javascript">
document.observe('dom:loaded', function(){Shadowbox.init();});
</script>
*/?>
<?php
/* ################################# YUI #################################### */
/*
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/lib/yui-utilities.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/adapter/shadowbox-yui.js"></script>
<script type="text/javascript" src="<?php echo $url; ?>/wp-content/plugins/shadowbox/src/js/shadowbox.js"></script>
<script type="text/javascript">
YAHOO.util.Event.onDOMReady(Shadowbox.init);
</script>
<script type="text/javascript">
window.onload = Shadowbox.init;
</script>
*/
?>
<?php
}
//add Action
add_action('wp_head', 'shadowbox_init');
?>