I am creating a view and I wanted to group the results by year and month.
I followed this tutorial and registered the custom shortcode, which worked fine: https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/
I have a custom field for dates, so I just used that, instead of the post date and it works well.
So far, so good.
How can I go on about this? Would you be able to provide a code snipped to fix my problem?
I am using the Classic editor and not Gutenberg, because our main editor is WPBakery.
Hello. Thank you for contacting the Toolset support.
Basically, for the solution shared what happens is view will loop through the posts order by custom date field as as the result it already order by custom date field the results will be available in order form Jan-Dec and we can then use the heading code.
I would like to know that, you have multiple instance date field - correct? If yes, in that case it will not be possible. I will require to understand your setup first. Can you please share problem URL where you are displaying the view as well as admin access details so I can check and see if I can able to share any possible solution.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked and based on the structure you shared and I see you are using the repeating date field and there is no way to group those posts by month and year.
One solution I can think of is you will have to set your date field as single instance field and then duplicate the event for other date as well.
For instance:
=> hidden link
See the above event, You have set the event date to march 24,25,26 and April 21.
You will require to create event post for every date.
- Palliative Care Ethics (3 x 20 UE) and set date March 24
- Palliative Care Ethics (3 x 20 UE) and set date March 25
- Palliative Care Ethics (3 x 20 UE) and set date March 26
- Palliative Care Ethics (3 x 20 UE) and set date April 21
So, instead on having 1 post and assign multiple dates to it using repeating field, you will have to create a post per date(that means you will have to duplicate your post and set date).
You should try to give a try for 1 post and see if it displays correctly, if yes, then you can go and duplicate every post per date.
Hello Minesh,
thank you for checking! I want to avoid that option to be honest.
Drupal basically uses a calendar feature. Is there any way to get this with toolset? I read that there's a feature in development for a few years now. Are there any more updates of this?
Is there any other way or is installing a plugin like "The Events Calendar" (https://toolset.com/forums/topic/calendar-view/#post-1704825) the only way?
Another thing: How do I disable the troubleshooting Views/Content-Templates Popup?
Since you logged in, it always appears when I open a page (frontend) where Toolset is active. I use firefox.
You should try to install the "The Events Calendar" plugin and check if you able to order events as per your requirement using that plugin without using Toolset.