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

it2022-05-09  24

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

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

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

第三步使用wp_list_categories提取分类

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

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

显示效果如下

全部代码

<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>

 

转载于:https://www.cnblogs.com/imlions/p/4450998.html


最新回复(0)