doukougua7873 2010-12-24 23:34
浏览 40
已采纳

single.php wordpress中的类别描述

any ideas.

this works fine in category.php <?php echo category_description(the_category_id()); ?>

but it does not work in single.php, just the category id shows up not the description.

any ideas, how to get this done?

thanks in advance

edited:

  • 写回答

1条回答 默认 最新

  • dongsi2317 2010-12-26 05:22
    关注
    the_category_id() 
    

    has been deprecated. This should work instead.

    $category = get_the_category();
    echo category_description($category[0]->cat_ID);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部