Display list of categories filtered by date?

I have a sidebar on our intranet which lists, hierarchically, posts by category.Such as:-- HR---Events----PicnicHoweve

I have a sidebar on our intranet which lists, hierarchically, posts by category.

Such as:

-- HR
---Events
----Picnic

However, this list has gotten long, and some categories are no longer even used. I would like to only category links where there are posts less than a year old.

Right now, I am using the default Categories Widget in the sidebar, but I can use a different widget or hand-code it.

How would I best approach this?

I have a sidebar on our intranet which lists, hierarchically, posts by category.

Such as:

-- HR
---Events
----Picnic

However, this list has gotten long, and some categories are no longer even used. I would like to only category links where there are posts less than a year old.

Right now, I am using the default Categories Widget in the sidebar, but I can use a different widget or hand-code it.

How would I best approach this?

Share Improve this question edited Mar 11, 2013 at 17:39 Eugene Manuilov 11.4k4 gold badges44 silver badges50 bronze badges asked Mar 11, 2013 at 17:29 SteveSteve 3139 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I'm not sure if this question is correctly tagged since you mentioned you're using the Categories Widget. The tag is for the List Category Posts plugin.

Using the plugin, the first possible thing that comes to my mind is using the few available date parameters:

monthnum and year - List posts from a certain year or month. You can use these together or independently. Example: [catlist year=2015] will list posts from the year 2015. [catlist monthnum=8] will list posts published in August of every year. [catlist year=2012 month=12] will list posts from December 2012.

This is not available on the widget (yet), but you could add it as a shortcode in your template file:

<?php echo do_shortcode("[catlist id=3]"); ?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745132053a4613019.html

相关推荐

  • Display list of categories filtered by date?

    I have a sidebar on our intranet which lists, hierarchically, posts by category.Such as:-- HR---Events----PicnicHoweve

    11小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信