Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress:如何在帖子中添加滑块_Php_Jquery_Wordpress_Jquery Ui - Fatal编程技术网

Php Wordpress:如何在帖子中添加滑块

Php Wordpress:如何在帖子中添加滑块,php,jquery,wordpress,jquery-ui,Php,Jquery,Wordpress,Jquery Ui,我在wordpress的single.php文件中尝试了以下代码。我使用这些代码块来显示当前帖子的相关帖子 <ul class="step-nav clearfix"> <li class="prev button"> <?php echo previous_post_link('%link', 'Previous'); ?> </li> <li class="next button"> <?php echo n

我在wordpress的single.php文件中尝试了以下代码。我使用这些代码块来显示当前帖子的相关帖子

 <ul class="step-nav clearfix">
<li class="prev button">
    <?php echo previous_post_link('%link', 'Previous'); ?>
</li>
<li class="next button">
    <?php echo next_post_link('%link', 'Next'); ?>
</li>
</ul>

它显示下一个和上一个链接。现在的问题是,我不知道如何编写jquery代码,它将在不更改浏览器url的情况下滑动所有下一篇或上一篇文章。请帮忙

如果不想更改url和新帖子的幻灯片,可以使用ajax加载来加载内容

这是我正在使用的ajax导航示例代码,您可以相应地修改它

// Ajaxed navigation On Page
jQuery(document).ready(function(){
    jQuery('#latestvideo-wrapper').append('<div class="video-loader"></div>');
    jQuery('.videosarticle a').live('click', function(e)  {
    jQuery('#latestvideo-wrapper .video-loader').fadeIn(500);
    e.preventDefault();
    var link = jQuery(this).attr('href');
    jQuery('#latestvideo-wrapper #latestvideobox').fadeOut(100).load(link + ' #latestvideobox', function() {
    jQuery('#latestvideo-wrapper .video-loader').fadeOut(400);
    jQuery('#latestvideo-wrapper #latestvideobox').fadeIn(500);
     });
    });
});
//页面上的Ajaxed导航
jQuery(文档).ready(函数(){
jQuery(“#最新视频包装器”).append(“”);
jQuery('.videosarticle a').live('click',函数(e){
jQuery('#latestvideo wrapper.video loader').fadeIn(500);
e、 预防默认值();
var link=jQuery(this.attr('href');
jQuery(“#latestvideo包装器#latestvideobox”).fadeOut(100).load(链接+”#latestvideobox',函数(){
jQuery('#latestvideo wrapper.video loader').fadeOut(400);
jQuery(“#最新视频包装器#最新视频盒”).fadeIn(500);
});
});
});
根据该代码,以前的内容正在淡出,而新内容正在淡入