Друзья, подскажите, пожалуйста, где в коде ошибка
<?php
add_theme_support( 'woocommerce' );
wp_enqueue_script( 'mobilemenu', get_template_directory_uri() . '/lib/js/jquery.mobilemenu.js', array('jquery') );
add_action('wp_footer', 'themater_menu_js');
function themater_menu_js()
{
$return .= "<script type='text/javascript'>\n";
$return .= '/* <![CDATA[ */' . "\n";
$return .= "if (jQuery('#pagemenucontainer').length > 0) {
jQuery('#pagemenucontainer').mobileMenu({
defaultText: 'Menu',
className: 'menu-primary-responsive',
containerClass: 'menu-primary-responsive-container',
subMenuDash: '–'
});
} else if (jQuery('#pagemenu').length > 0) {
jQuery('#pagemenu').mobileMenu({
defaultText: 'Menu',
className: 'menu-primary-responsive',
containerClass: 'menu-primary-responsive-container',
subMenuDash: '–'
});
} \n";
$return .= "if (jQuery('#navcontainer').length > 0) {
jQuery('#navcontainer').mobileMenu({
defaultText: 'Navigation',
className: 'menu-secondary-responsive',
containerClass: 'menu-secondary-responsive-container',
subMenuDash: '–'
});
} else if (jQuery('#nav').length > 0) {
jQuery('#nav').mobileMenu({
defaultText: 'Navigation',
className: 'menu-secondary-responsive',
containerClass: 'menu-secondary-responsive-container',
subMenuDash: '–'
});
} else if (jQuery('.navcontainer').length > 0) {
jQuery('.navcontainer').mobileMenu({
defaultText: 'Navigation',
className: 'menu-secondary-responsive',
containerClass: 'menu-secondary-responsive-container',
subMenuDash: '–'
});
} \n";
$return .= '/* ]]> */' . "\n";
$return .= '</script>' . "\n";
echo $return;
}
?>
И вот еще один. Он должен прокручивать изображения. Может сним что-то не так?
<?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><?php echo $i; ?></h3>
<p></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 } ?>