さて、ここに私の問題があります。
おすすめのコンテンツ スライダーを自分の Web サイトに配置するのに、おそらく 10 時間ほど費やしました。私が思いつくことができるものは何でも試してみてください。同じスライダーのおそらく 3 つの異なるバージョンを試しています。
URL はhttp://www.heartofphoto.com/slidetest/
とにかく、これが私が現在行っていることです:
ヘッダーで私はこれを得ることができました:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.3/jquery-ui.min.js'></script>
「noconflict」の部分があるかどうかは、実際には違いがないようです。そして、Wordpress用の「google libary」プラグインをインストールした後、noconflictの部分が入ったと思います。
そして、スライダーを表示するページ内にあるスクリプトは次のとおりです。
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
});
</script>
私が作成した "featured.php" ファイルにそれを含めても、先頭に含まれている header.php ファイルに含めても、違いはありません。
誰が私が間違っているのか手がかりを持っていますか?
いくつかの編集: エラー SCRIPT438: Object does not support this property or method in slidetest, line 139 character 3 が表示されます。これは次の行です:
jQuery("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
そして、私の html を見たい人のために。このバージョンでは、実際に php セットアップを使用してデータを取得しています。
<div id="featured" >
<ul class="ui-tabs-nav">
<?php
$postcount = 0;
$featured_query = new WP_Query('cat=29');
while ($featured_query->have_posts()) : $featured_query->the_post();
get_the_ID();
$postcount++;
?>
<?php
// get the image filename
$value_feat_img = get_post_custom_values("thumbnail");
if (isset($value_feat_img[0])) { ?>
<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-<?php echo $postcount; ?>"><a href="#fragment-<?php echo $postcount; ?>">
<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumbnail", $single = true); ?>&h=50&w=80&zc=1&q=95" alt="<?php the_title(); ?>" /><span><?php the_title(); ?></span></a><?php } ?>
</li>
<?php endwhile; ?>
</ul>
<?php
$postcount = 0;
$featured_query = new WP_Query('cat=29');
while ($featured_query->have_posts()) : $featured_query->the_post();
get_the_ID();
$postcount++;
?>
<!-- Content -->
<div id="fragment-<?php echo $postcount; ?>" class="ui-tabs-panel" style="">
<?php // get the image filename
$value_img = get_post_custom_values("thumbnail");
if (isset($value_img[0])) { ?>
<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "thumbnail", $single = true); ?>&h=300&w=390&zc=1&q=95" alt="<?php the_title(); ?>" />
<?php } ?>
<div class="info" >
<h2><a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; ?>
</div>