WORDPRESS开发(一)自定义页面显示分类目录

第一步:
自定义一个页面,如index.phpphp

第二步:
打开index.php文件,引用wp-blog-header.php文件css

require('wp-blog-header.php');

第三步
使用wp_list_categories提取分类ui

$args=array('title_li'=> '');
wp_list_categories($args);

‘title_li’=> ” 用于设置不显示“分类目录”标题,其它的使用默认。spa

显示效果以下code

所有代码blog

<style type="text/css">
    body{
        font-size:16px;
        font-family: 微软雅黑;
    }
    .categories{
        list-style: none;
        padding:0;
    }
    .categories li{
        list-style:none;
    }
    .categories a{
        text-decoration: none;

    }
    .categories a:hover{
        text-decoration: underline;
    }
</style>
<ul class="categories">
<?php 
require('wp-blog-header.php');

$args=array('title_li'=> '');
wp_list_categories($args);
?>
</ul>
相关文章
相关标签/搜索