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
From github.com
- Download catposts.
- Upload the 'catposts' directory to your '/wp-content/plugins/' directory, using your favorite method (ftp, sftp, scp, etc...)
- Activate Category Post Lists from your Plugins page.
Use the following shortcode: [catposts]
The shortcode has the following attributes:
orderby
- 'id'
- 'count'
- 'name' - Default
- 'slug'
hide_empty
- 1 (true) - Default (i.e. Do not show empty categories)
- 0 (false)
order
- DESC - Default
- ASC
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
include An a string of comma-separated category ids to exclude. e.g.
- 0 - Default
- '1,20,39' - i.e. Show only these categories
e.g. [catposts orderby='id' exclude='1,20,39']
post_order
- DESC - Default
- ASC
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
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>
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Copyright (C) 2015 Rew Rixom (email : rew@rixom.org)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA