Skip Navigation

[Resolved] View showing Post Date Month and Post Count for each month?

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have a Post Category called News Articles. We would like to create a View that will display a list of months and post counts for the News Articles category.

Solution:

You can try the WordPress built-in feature "Archives Widget":

Relevant Documentation:

https://developer.wordpress.org/reference/functions/wp_get_archives

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by katinaA 9 months, 2 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#2289003

I have a Post Category called News Articles. We would like to create a View that will display a list of months and post counts for the News Articles category.

The test example we are trying to emulate that was created in Drupal's Views is here:

hidden link

It shows only the months that have articles created within those months. Then it shows a post count for the number of News Articles within that month.

Then when you click on any of the months, it takes you to a page showing the results for only that month with the formatting of that page being customizable to show the Post Title, an excerpt, post author, post date and tags.

In Drupal Views this capability is called a Contextual Filter to have that date/count page in front of the results page. I don't know if your plugin has this capability or not. Any assistance you can provide towards achieving this goal would be appreciated.

The View we're creating now is here:

hidden link

And the page where it will be displayed is here:

hidden link

We can provide admin access if necessary.

#2289289

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Archives Widget.jpg

Hello,

I assume the "News Articles" is a term of taxonomy "category".

If it is, there isn't such kind of built-in feature within Toolset plugins, you can consider the WordPress built-in feature "Archives Widget":
https://developer.wordpress.org/reference/functions/wp_get_archives/#comment-3182
it can also display the post counts, see my screenshot

And you can also use custom codes to specific the taxonomy terms, see the comment of above document:

To filter a specific category/term, we have a specific case to add filters.
...

#2289371

Thanks! I was able to get that to achieve the goal. I had to install another plugin called AMR Shortcode Any Widget to display the results in the main part of the page, but it worked.

#2289373

My issue is resolved now. Thank you!