Category Post Lists Usage

A super simple WordPress plugin that prints out, from a shortcode, a list of linked category titles and a nested list of related published list of linked post titles

Installation

From github.com

  1. Download catposts.
  2. Upload the ‘catposts’ directory to your ‘/wp-content/plugins/’ directory, using your favorite method (ftp, sftp, scp, etc…)
  3. Activate Category Post Lists from your Plugins page.

Usage

Use the following shortcode:

[catposts]

The shortcode has the following attributes:

These attributes affect category titles only

Attribute:

orderby

  • ‘id’
  • ‘count’
  • ‘name’ – Default
  • ‘slug’
Attribute:

hide_empty

  • 1 (true) – Default (i.e. Do not show empty categories)
  • 0 (false)
Attribute:

order

  • DESC – Default
  • ASC
Attribute:

exclude
An a string of comma-separated category ids to exclude. e.g.

  • 0 – Default
  • ‘1,20,39’ – i.e. Do not show these categories
Attribute:

include
An a string of comma-separated category ids to exclude. e.g.

  • ‘ ‘ – Default
  • ‘1,20,39’ – i.e. Show only these categories

e.g. [catposts orderby='id' exclude='1,20,39']

These attributes affect post titles only

Attribute:

post_order

  • DESC – Default
  • ASC
Attribute:

post_orderby the default is ‘date’ it can be set to:

  • ‘ID’ – Order by post id. Note the capitalization.
  • ‘author’ – Order by author.
  • ‘title’  – Order by title.
  • ‘name’ – Order by post name
  • ‘date’ – Order by date.
  • ‘modified’ – Order by last modified date.
  • ‘rand’ – Random order.
  • ‘comment_count’ – Order by number of comments

HTML Output


CSS classes are included but not styled by the plugin

h3.cat-titles

li.post-titles


<ul class="catposts">
<li>
<h3 class="cat-titles">
<a href="http://wpsite.co/?cat=20">Edge Case</a>
</h3>
<ul>
<li class="post-titles">
<a href="http://wpsite.co/?p=1000">Nested And Mixed Lists</a>
</li>
<li class="post-titles">
<a href="http://wpsite.co/?p=1151">Many Tags</a>
</li>
</ul>
</li>
<li>
<h3 class="cat-titles">
<a href="http://wpsite.co/?cat=5">Arrangement</a>
</h3>
<ul>
<li class="post-titles">
<a href="http://wpsite.co/?p=1152">Many Categories</a>
</li>
</ul>
</li>
</ul>