最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - Shortcode to output category description by passing ID

programmeradmin1浏览0评论

I have this shortcode function:

function category_description_output($atts) {
  $atts = shortcode_atts( array(
    'catID' => '16'
  ), $atts, 'categorydescription' );

  return category_description( $atts['catID'] );
}
add_shortcode('categorydescription', 'category_description_output');

My shortcodes look like this:
[categorydescription catID=16]
[categorydescription catID=17]
[categorydescription catID=18]
[categorydescription catID=19]

But they are all outputing the category description for the default ID of 16.

发布评论

评论列表(0)

  1. 暂无评论