{"id":43697,"date":"2011-07-13T08:00:00","date_gmt":"2011-07-13T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/count-shortcode\/"},"modified":"2011-09-28T23:52:00","modified_gmt":"2011-09-28T23:52:00","slug":"count-shortcode","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/count-shortcode\/","title":{"rendered":"Count Shortcode"},"content":{"rendered":"<p>Shortcode to count number of posts that match a given set of criteria; provides link to query to display list of matching posts.<\/p>\n<p>Works with both built in post types (pages, posts) and taxonomies (tags, categories), as well as custom post types and custom taxonomies.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>You have a car custom post type and would like a count of all the red cars in your inventory, as well as a link to a listing of those cars.<\/p>\n<p>Red Cars in Inventory: [count color=red]<\/p>\n<p>Would return the number of cars, as well as a link to yoursite.com\/?color=red (which may rewrite depending on your permalink structure)<\/p>\n<p><strong>Usage<\/strong><\/p>\n<p>Insert a shortcode in your post in the form of [count {taxonomy}={value}]. You can add as many or as fiew taxonomies as you would like.<\/p>\n<p>You can also use the post_type argument to specify a post type (page, post, car, etc.)<\/p>\n<p><strong>List Usage<\/strong><\/p>\n<p>You can count all terms within a taxonomy, e.g., [list-counts taxonomy=\u201dtags\u201d] or across all taxonomies [list-counts].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shortcode to count number of posts that match a given set of criteria; provides link to query to display list of matching posts<\/p>\n","protected":false},"author":65,"featured_media":257655,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Count Shortcode - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Shortcode to count number of posts that match a given set of criteria; provides link to query to display list of matching posts"},"footnotes":""},"categories":[1],"tags":[14858,4056,2830,345,481],"class_list":["post-43697","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-counting","tag-data","tag-queries","tag-shortcode","tag-statistics"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/43697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=43697"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/43697\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/257655"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=43697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=43697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=43697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}