posts - Create a tree with categories with get_posts()

I have my posts using this code :$dataQuery = ['numberposts' => -1,'post_type' => '

I have my posts using this code :

$dataQuery = [
    'numberposts'   => -1,
    'post_type'     => 'documentation',
    'meta_query'    => $meta_query,
];

$documentations = get_posts($dataQuery);

Where $meta_query is an array. It's working, I have my posts, but I want to show a tree with the categories and the posts inside ? Is it possible easily ?

For now, I will get my categories and loop over them and then get posts for each category... Since get_posts() doesn't return any information about the category. I guess there is a better way ?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744704881a4588996.html

相关推荐

  • posts - Create a tree with categories with get_posts()

    I have my posts using this code :$dataQuery = ['numberposts' => -1,'post_type' => '

    23小时前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信