Tell us what you are trying to do?
Hi, I have created an Events CPT where there are start and end datetime fields.
Now, I need to create a calendar, that I put it in a sidebar or in the footer with a shortcode, where the days that has an event are linkable to the day archive page where are listed all the events of that day.
Similar to the Toolset Maps, where I can display the marker of all "posts" that has a location field.
So, now I can display only the calendar with a single event CPT post, but I want and I need to dispaly the calendar with all Event CPT posts.
What should I do to do that?
Is there any documentation that you are following? I don't know
Is there a similar example that we can see? I don't know
What is the link to your site? the site is under development in a local machine.
Hi, there isn't a calendar-style display built into Views right now so it would require a significant amount of custom code with PHP, HTML and CSS. I don't have any code snippets available to help create this, as it would be rather complex...it is really a completely new feature. We plan to create a calendar display for Views, but it's not ready yet. We've asked for some feedback on our blog about displaying posts on a calendar: https://toolset.com/2019/06/do-you-need-calendar-view-for-toolset/
If you'd like to see a calendar added, this is the place to submit your comments. Amir will take everything into consideration while planning the new calendar View.
Hi Christian,
Thank you, but I cannot write my comment because the discussion is closed.
But, if I select to show the date field value, I can choose the calendar option (see the attached image), but I can display in the calendar only the post date. But it is strange to have this option for a single post and not for all posts date field like as maps.
The problem isn't displaying a single date on a calendar. The problem is displaying multiple dates from multiple posts on the same calendar. It is not possible in Views.
Hi francesco,
i may be able to help with custom code i had a similar issue i resolved with shortcode to display calendar of CPT .
francisco
Hi Francisco,
can you help me sending me the custom code that you have used?
Thank you!!!
I'll leave this ticket open in case more discussion is needed.
Thank you Christian.
Francisco, are you here? Can you hlep me?
Yes , francesco i cant put all the codes here. first need to create a post form 'Calendar' ,remove all cred fields . this the form
to put on thepage.
In the form just need div element with an id, is the wrapper for the calendar:
<div id="calendar"></div>
Initialize in the form or JS editor:
<script>
$(function() {
// var title = $("input[name='post_title']").val();
$('#calendar').eCalendar({
ajaxDayLoader : "/wp-content/plugins/hb-shortcodes/hg-days-sql.php",
ajaxEventLoader : "/wp-content/plugins/hb-shortcodes/hg-events-sql.php",
eventsContainer : "#hb-event-list",
currentMonth : 10,
currentYear : 2019,
startMonth : 1,
startYear : 2019,
endMonth : 12,
endYear : 2020,
title : title,
firstDayOfWeek : 1,
onBeforeLoad : function() {} ,
onAfterLoad : function() { },
onClickDay : function() {}
});
});
</script>
also i need to know the fields of cpt Event post ,start date to adjust the sql. then we can install rest of the script.
Hello Francesco, just checking to be sure you received the latest message from Francisco.
Hi, sorry,
I see now the reply, I don't have received the email notification.
Thank you Francisco for your tip&tricks.
The fields of cpt Events are: "data-inizio", "data-fine" and "indirizzo". The two date fields are "datetime" fields.
Then, why "first need to create a post form 'Calendar' and remove all cred fields and this the form
to put on thepage"? Why I cannot create a widget or a shortcode?
Hi francesco
shortcode is already created for you by post form [cred_form form="calendar"] . can try view shortcode [wpv-view name="calendar"]. remove cred fields is so shortcode just display calendar , you not need to add data.
On post form clicking on days can link to events.
Hi Francisco,
thank you.
So, I don't need to use the datetime fields value in the code?
and, in the following part of your previous code, I cannot use dynamic value? They need to be changed manually?
currentMonth : 10,
currentYear : 2019,
startMonth : 1,
startYear : 2019,
endMonth : 12,
endYear : 2020,
Hi Francesco
You need to use datetime values to get the event days of each month to display on calendar. for the code yes need to changed manually.
Hello, I'm commenting again so the system will keep the thread open for discussion.