【发布时间】:2012-02-14 17:14:05
【问题描述】:
我对 wordpress、html、css 和 javascript 还是很陌生,如果可能的话,我很想得到你的帮助:
我正在尝试为我的博客的特色内容区域创建一个双滑块,其中左侧滑块上有三个精选的 youtube 视频,右侧滑块上有帖子摘录。 Here's how I picture it.
我认为我目前这样做效率低下;使用dualslider
现在我在右侧面板上有三个 div,每个帖子对应一个在每个 div 中输出 the_excerpt() 的帖子:
<div class="detail" >
<?php $args=array('tag' => 'Featured1', 'showposts'=>1, 'caller_get_posts'=>1);
$my_query = new WP_Query($args);
if( $my_query->have_posts() )
{
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" <?php the_title(); ?></a></p>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<h3><?php the_excerpt(); ?></h3>
<?php endwhile;
}
wp_reset_query(); ?>
</div><!--END detail1-->
左侧有三个 div,每个视频对应一个将 the_content 输出到每个 div 的视频:
<div class="detail" >
<?php $args=array('tag' => 'Featured1', 'showposts'=>1, 'caller_get_posts'=>1);
$my_query = new WP_Query($args);
if( $my_query->have_posts() )
{
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" <?php the_title(); ?></a></p>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<h3><?php the_content(); ?></h3>
<?php endwhile;
}
wp_reset_query(); ?>
</div><!--END detail1-->
我想要推荐的三个帖子分别标记为 Featured1、Featured2 和 Featured3,帖子内容只是 iframe youtube 嵌入代码,后跟我想要在正确内容面板中显示的任何内容。
最后,由于我不太了解双滑块 javascript 文件,除了很难格式化视频的轮播大小之外,我的另一个问题是,当您从幻灯片移动到时,我需要暂停当前正在播放的视频幻灯片类似于 AnythingSlider (http://css-tricks.com/examples/AnythingSlider/#panel1-4) 中提供的功能。
任何帮助将不胜感激。谢谢!
【问题讨论】:
-
caller_get_posts已弃用。 -
我觉得整个东西都是垃圾,但是我应该用什么代替呢?
-
好吧,老实说,您的方法可能不是最好的。您应该只使用一个循环来提高性能。然后,如果你对这一切都不熟悉,我建议你从更简单的开始。这会变得太复杂了......
-
我不会轻易气馁。如果你真的想帮我给我发一封电子邮件,我可以更好地向你解释我想要完成的工作。
标签: jquery wordpress slider anythingslider