WordPress制作时间轴文章列表页面
wordpress主题的文章归档页面样式大多是普通的文章标题列表页面,那今天测速网给大家分享一组可以实现时间轴列表展示的文章归档页面代码,方便更清新的在页面中展示出标题及文章,且提供给大家前端的css及js,而且有展开文章列表功能,体验与适配程度都比较好。
将下面的代码复制进页面模版内
123456789101112131415161718192021222324252627<div ><?php$previous_year = $year = 0;$previous_month = $month = 0;$ul_open = false;$myposts = get_posts('numberposts=-1&orderby=post_date&order=DESC');foreach($myposts as $post) :setup_postdata($post);$year = mysql2date('Y', $post->post_date);$month = mysql2date('n', $post->post_date);$day = mysql2date('j', $post->post_date);if($year != $previous_year || $month != $previous_month) :if($ul_open == true) : echo '</ul>';endif;echo '<h3 >'; echo the_time('Y-m'); echo '</h3>';echo '<ul >';$ul_open = true;endif;$previous_year = $year; $previous_month = $month;?><li><a href="<?php%20the_permalink();%20?>"><span><?php the_time('Y-m-j'); ?></span><div ><?php the_title(); ?></div></a></li><?php endforeach; ?></ul></div>CSS样式
将css样式代码添加到wordpress主题和style.css样式表内。
JS特效
点击月份伸缩效果,放在js标签内部即可
上一篇:纯代码wordpress主题禁止复制粘贴文章内容的方法
下一篇:wordpress 主题缺少style.css无法安装这个包解决办法
winlogins.exe是什么文件?winlogins.exe是不是病毒
winsock2.6.exe是什么文件?winsock2.6.exe是不是病毒
WinDefendor.dll是什么文件?WinDefendor.dll是不是病毒
系统目录是什么文件?系统目录是不是病毒
wholove.exe是什么文件?wholove.exe是不是病毒
winn.ini是什么文件?winn.ini是不是病毒
w6oou.dll是什么文件?w6oou.dll是不是病毒
winduxzawb.exe是什么文件?winduxzawb.exe是不是病毒
wuammgr32.exe是什么文件?wuammgr32.exe是不是病毒
windiws.exe是什么文件?windiws.exe是不是病毒