dta38159 2018-06-27 10:31
浏览 67

PHP滑块基于Wordpress中活动类别的当前帖子

Hello fellow community,

I'm pulling my hair off for the past 3 days.

I tried many post / gallery / sliders plugins on Wordpress, and I cannot get the result I was looking for.

Basicaly what I would like to do is to generate a dynamic slider based on the current posts from the active category page. The posts are all listed under the same category. The slider must display ONLY the posts belonging to the current category.

I tried to customize the category.php page with Slider Revolution but it only retrieve "the most recent" post and not the rest.

I tried with many others plugins but they all display posts from other categories.

Thank you very much for your help.

  • 写回答

1条回答 默认 最新

  • dongmei3498 2018-06-27 10:41
    关注

    So a bxslider could look something like this

    <?php 
    if ( have_posts() ) : ?>
        <div class="bxslider">
          <?php while ( have_posts() ) : ?>
               <?php the_post();?> 
                <div class="whateverClassHere">whatever content here <?php echo get_the_title(); ?></div>
          <?php endwhile; ?> 
       </div>
    <?php endif; ?>
    

    And then you would initiate it with Jquery

    $('.bxslider').bxslider(); //read the docs for settings here.
    
    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作