Support » Plugin: List category posts » A Couple of Suggestions (and One Teensy Error)

  • We have been using LCP for about a year now and it was great to be able to display exactly what I wanted on my sidebars. So I just want to start out saying thank you so much for this plugin!

    The only “problems” I have is that I currently need to edit the files of the plugin to make it do exactly what I want. Now that I’ve found out that I can use shortcodes in the “Text” widget, I can now eliminate most of the edits I was doing. All except one. So, on to my suggestions!

    I notice that you have it set up now that you can use “catlink” as the title of the widget to use the name of the category itself and make it a link to the category page. We don’t use the category pages themselves and just link directly to the pages (using this wonderful plugin). So my suggestion is to add another variable in the title such as “catname” which would just display the name itself. If it helps, I was able to add this myself by adding the following after line 63 in include\ListCategoryPostsWidget.php:

    elseif($title == 'catname'){
          global $post;
          //if the user has setup 'catname' as the title, replace it with the category link:
          $lcp_category = get_the_category($post->ID);
          $title = $lcp_category[0]->name;

    Note: I used the code above because it would show the current category’s title since that was all I wanted it for. It probably wouldn’t work for set category listings being shown on other categories’ pages.

    I also just want to add that when using “catlink” as the title of the widget and selecting “Current Category” as the category it actually leaves the title blank. When in WordPress’s debug mode, the following error appears:
    LCP Version 0.48
    Notice: Trying to get property of non-object in [...]\list-category-posts\include\ListCategoryPostsWidget.php on line 62
    Maybe having another “if” statement checking to see if the “Current Category” is selected and using a form of the sample I use above would be helpful.

    My last suggestion is something that I’m not exactly sure can be done as the plugin is now, but it would be great to have! I would love to be able to see sub-categories in the category listing. I think it already works where it will show all child category posts, but I would like to be able to see the hierarchy as well. For example I have the following post listing in my category:

    A Post 1
    B Post 2
    Child Category <– With option to not have this link to the category page
    …. Post A <– These post titles are indented to show that they belong to the child category
    …. Post B
    D Post 3

    So in this we’ll say my widget is set up to show posts in ascending alphabetical order. It shows the first few posts then it gets to the child category which has posts inside as well then goes on to show the rest of the posts in the parent category.

    It would still be great even if the child category’s posts had to be displayed at the end of the list.

    As a bonus it would be nice if the child category could be expandable and collapsible, but that’s not completely necessary.

    I’m sure I was horrible at explaining all of that so please feel free to ask any questions if you think the idea might be doable.

    As a recap and TL;DR:
    Suggestion 1: A “catname” variable for the title to show just the category name.
    Error: When using “Current Category” the existing “catlist” variable for the title doesn’t work.
    Suggestion 2: Showing child categories in the category listing as a hierarchy. (With a bonus of making it expand/collapsible.)

    I hope I haven’t offended you by giving my suggestions or the suggestions on how to fix the error I found either. I promise, that was never my intention.

    As always, thank you so much for your help and your plugin. It’s really great and helpful to my website!

    I hope you have a wonderful day!


Viewing 1 replies (of 1 total)
  • Plugin Author Fernando Briano


    Hi Ari,
    Just a quick note to let you know I read this and I’m really thankful for the time you took to write this extensive post! Of course I’m not offended, on the contrary, constructive criticism and feedback are awesome and very welcome 😀

    Suggestion 1 has been resolved (I think it was on version 0.48). I’ll check out the error and your second suggestion.

    Thanks for using the plugin, I’m really glad it’s helped you.



Viewing 1 replies (of 1 total)
  • The topic ‘A Couple of Suggestions (and One Teensy Error)’ is closed to new replies.