wordpress自定义404页面
2017-03-12 10:21
225 查看
404页面自定义是每个网站不可以或缺的,不同的网站创意也有所不同。今天我们给begin主题的404页面加一个文章归档,操作很简单。
先上效果图
具体步骤如下
第一步、找到文章归档的调用代码
打开begin/pages/template-archieves.php,
上面代码有增删,有增删,有增删(大家灵活使用)
第二步、编辑404页面
打开begin/404.php,在
后面粘贴第一步复制的代码。这样,功能需求就实现了,赶快来试一试,定制你自己的404页面吧。
原文地址:http://liuyanzhao.com/2308.html
先上效果图
具体步骤如下
第一步、找到文章归档的调用代码
打开begin/pages/template-archieves.php,
<h2> 当然,你也可以看看其他精彩内容哟!</h2> <br> <style type="text/css"> .year { font-size: 16px; margin: 10px -21px 10px -21px; padding: 0 20px; border-bottom: 1px solid #ebebeb; border-left: 5px solid #0088cc; } .mon { color: #000; line-height: 30px; margin: 5px 0 5px 5px; cursor: pointer; } .post_list li { line-height: 30px; text-indent: 2em; } .post_list { color: #999; margin: 0 0 10px 0; } .mon-num { color: #999; margin: 0 0 0 10px; } </style> <?php require get_template_directory() . '/inc/function/archives.php'; ?> <div class="archives"> <?php cx_archives_list(); ?> </div> <script type="text/javascript"> $(document).ready(function(){ (function(){ $('#all_archives span.mon').each(function(){ var num=$(this).next().children('li').size(); var text=$(this).text(); $(this).html(text+' <span class="mon-num">'+num+' 篇</span>'); }); var $al_post_list=$('#all_archives ul.post_list'), $al_post_list_f=$('#all_archives ul.post_list:first'); $al_post_list.hide(1,function(){ $al_post_list_f.show(); }); $('#all_archives span.mon').click(function(){ $(this).next().slideToggle(400); return false; }); })(); }); </script>
上面代码有增删,有增删,有增删(大家灵活使用)
第二步、编辑404页面
打开begin/404.php,在
<?php get_search_form(); ?>
后面粘贴第一步复制的代码。这样,功能需求就实现了,赶快来试一试,定制你自己的404页面吧。
原文地址:http://liuyanzhao.com/2308.html
相关文章推荐
- ubuntu 下 wordpress 设置 Permalink 为 自定义结构后出现404页面 nginx - 404 not found page for permalinks
- 建立自定义的WordPress数据库错误页面
- apache之404错误页面自定义跳转说明
- 在ASP.NET MVC 如何在Response.StatusCode = 404的同时,显示友好的自定义错误页面
- Nginx自定义404错误页面并返回404状态码
- 在Tomcat中配置404自定义错误页面全解
- web.xml 配置404和500错误的自定义页面
- 自定义404页面常识
- 500错误自定义页面不显示,但404自定义页面显示的解决方法
- 在Tomcat中配置404自定义错误页面全解
- web.xml 配置404和500错误的自定义页面
- 使用Google网站管理员工具自定义404页面
- Apache之404错误页面自定义跳转说明
- nginx 0.7.x 自定义404 403错误页面
- 404错误、500错误、异常错误提示页面的拦截和自定义
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- web.xml 配置404和500错误的自定义页面
- Tomcat 设置自定义的 404 错误页面
- 今天网站wordpress所有页面全部都404了,把固定链接重新“确定下”就好了