{"id":3868,"date":"2008-10-18T03:42:21","date_gmt":"2008-10-18T03:42:21","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/count-posts\/"},"modified":"2008-10-18T04:07:35","modified_gmt":"2008-10-18T04:07:35","slug":"count-posts","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/count-posts\/","author":33772,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0","stable_tag":"1.0","tested":"2.6.2","requires":"2.1","requires_php":"","requires_plugins":"","header_name":"Count Posts","header_author":"Andrew Hamilton","header_description":"","assets_banners_color":"","last_updated":"2008-10-18 04:07:35","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/code.andrewhamilton.net\/donate\/","header_plugin_uri":"http:\/\/code.andrewhamilton.net\/wordpress\/plugins\/count-posts","header_author_uri":"http:\/\/andrewhamilton.net\/","rating":0,"author_block_rating":0,"active_installs":20,"downloads":4858,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[442,170,243,86,166],"plugin_category":[],"plugin_contributors":[79033],"plugin_business_model":[],"class_list":["post-3868","plugin","type-plugin","status-closed","hentry","plugin_tags-count","plugin_tags-page","plugin_tags-pages","plugin_tags-post","plugin_tags-posts","plugin_contributors-hami","plugin_committers-hami"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/count-posts.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><em>Count Posts<\/em> is a simple plugin that provides a template function to count posts, as well as filtering by category and over time in days. The function can either return or display the result.<\/p>\n\n<p><em>Based off Clint Howarth's <code>count_posts<\/code><\/em><\/p>\n\n<h3>Changes<\/h3>\n\n<p><em>1.0<\/em><\/p>\n\n<ol>\n<li>Initial release.<\/li>\n<\/ol>\n\n<h3>Count Posts Function<\/h3>\n\n<p>The Count Posts function can be called anywhere in a WordPress template and has three variables:<\/p>\n\n<p><em><code>count_posts($category, $daysago, $display)<\/code><\/em><\/p>\n\n<p><em>$category<\/em><\/p>\n\n<p>The <code>$category<\/code> variable is used to count the number of posts in a category (or Term in WordPress 2.5 or greater). Simply put the name of your category in the function call e.g.<\/p>\n\n<p><em><code>count_posts('mycategory')<\/code><\/em><\/p>\n\n<p>If it is left blank, which is the default, the function will count post in all categories.<\/p>\n\n<p><em>$daysago<\/em><\/p>\n\n<p>The <code>$daysago<\/code> variable is used to count the number of posts from a specified number of days ago e.g.<\/p>\n\n<p><em><code>count_posts('mycategory', '8')<\/code><\/em><\/p>\n\n<p>If it is left blank or set to <code>0<\/code>, the default, the function will count all posts.<\/p>\n\n<p><em>$display<\/em><\/p>\n\n<p>The <code>$display<\/code> variable is used to either output the count number or to return it.<\/p>\n\n<p><em><code>count_posts('mycategory', '8', true)<\/code><\/em><\/p>\n\n<p>If it is left blank or set to <code>true<\/code>, the default, the function will output the number of posts to the page. If it is set to <code>false<\/code>, the function will return the number.<\/p>\n\n<h3>Known Issues<\/h3>\n\n<p>No known issues at this time.<\/p>\n\n<p>If you find any bugs or want to request some additional features for future releases, please log them the <a href=\"http:\/\/tracker.andrewhamilton.net\/projects\/show\/count-posts\">projects tracker page<\/a><\/p>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Download the archive and expand it.<\/li>\n<li>Upload the <em>count-posts<\/em> folder into your <em>wp-content\/plugins\/<\/em> directory<\/li>\n<li>In your <em>WordPress Administration Area<\/em>, go to the <em>Plugins<\/em> page and click <em>Activate<\/em> for <em>Count Posts<\/em><\/li>\n<\/ol>\n\n<p>Once you have <em>Count Posts<\/em> installed and activated you can call the function in your WordPress template.<\/p>","raw_excerpt":"Count Posts is a simple plugin that provides a template function to count posts, as well as filtering by category and over time in days.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/3868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=3868"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/hami"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=3868"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=3868"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=3868"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=3868"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=3868"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=3868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}