picandocodigo / List-Category-Posts

WordPress plugin which allows you to list posts from a category into a post/page using the [catlist] shortcode.
http://wordpress.org/extend/plugins/list-category-posts/
GNU General Public License v2.0
241 stars 112 forks source link

Feature Request: Display category / categories shortcode on every post #473

Closed ady001 closed 2 years ago

ady001 commented 2 years ago

This is a great plugin, but it lacks a shortcode to display the category name or multiple category names on each post. This is used mainly on news / blog sites that have posts in multiple categories and want to better highlight the topics. The code should be post_catname and/or post_catlink (display categories with links to them) Thank you!

picandocodigo commented 2 years ago

Hi @ady001, do you mean like the parameter catlink we already support? See the docs:

  • catlink - Show the title of the category with a link to the category. Use the catlink_string option to change the link text. Default is 'no'. Ex: [catlist catlink=yes]. When using more than one category a title of each of them is displayed. You can set a css class and an html tag to wrap the link in with catlink_class and catlink_tag (see HTML & CSS Customization). Tag defaults to strong.
klemens-st commented 2 years ago

I think what @ady001 meant is something like #103 but for categories. catlink doesn't show the links for each post separately.

ady001 commented 2 years ago

Wehn using catlink=yes, only a title with the selected category appears at the top of the posts list EG: Category Name (with link)

ady001 commented 2 years ago

For example and reference I'm using the plugin Display Posts – Easy lists, grids, navigation, and more, By Bill Erickson. That plugin has the requested feature. :)

klemens-st commented 2 years ago

@ady001 I already have an implementation ready for a very similar feature for tags in #476 and I could add a similar one for categories. But I've just realised it would be better to include everything in one feature that supports all taxonomies: categories, tags and any custom taxonomies.

The question is: do you think it's enough if users can select just one taxonomy, say categories, or should I allow displaying more, say categories and tags at the same time?

ady001 commented 2 years ago

@klemens-st I think that the more flexible the better. Having the option to display categories and/or tags at the same time is ideal Great work so far !

klemens-st commented 2 years ago

The display tags feature has been merged, I have refactored the code to be cross compatible with other taxonomies.

So now it's enough to add shortcode parameters for categories and reuse the code I've already added. The shortcode parameters will be analogous to those for tags, working exactly the same.