This support ticket is created Il y a 4 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.
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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
But the same days simply repeat over and over again instead of filtering into the correct days of the week. Is this an issue with the function or the view?
Based on what I see from the code it is only passing the current day into the view rather than the current Date.
What you want to pass into the view is Today's date rather than the day of the week correct ? What this means that only posts that have Todays actual date will show up rather than the day of the week.
Well, I don't want to hardcode todays date. If that is what you mean. I want to automatically fill the week by day - IOW put mondays stuff under Monday, tuesdays's stuff under Tuesday etc...
And only show the current week, starting on Thursday (for example).
Well, I may want to do both. Provide a week view and a month view- I think that is what you are asking? But for now I'm most concerned with the week (Friday-Thursday).
You can only do one at a time, you're not able to do both.
Perhaps i'm not understanding the full picture as to what you are trying to achieve with these date views. Maybe if I know this then I can better able to assist.
Right now I see that you want to display posts for different days using different view.
It is checking is Today's day is the same as the one that has been entered into the shortcode, then converting this to a timestamp to pass to the view to filter based on Todays day.
This will give all posts that are for Thursday both in the past and future. If you want only future Thursday posts please let me know.
Thanks,
Shane
Well, It depends upon when you open the page. If the week is Friday-Thursday but you open it on Wednesday - which Wednesday did you open? The Wednesday before or during? So the point is, I want to be able to build schedules for people and then allow them to view on a F-Tr basis. But those schedules could change over the course of the week. I'm not sure if my explanation helps.
If the week is Friday-Thursday but you open it on Wednesday - which Wednesday did you open?
If I open the schedule for Wednesday you want to show all the persons rostered for Wednesday, what i'm really confused about is if you want it to be This wednesday or This and Future Wednesdays.
Once I understand this we can move to achieve a fix or a recommendation. I'm assuming that you wouldn't want to display Past Wednesdays only this and future wednesdays.
Actually, I cannot predict what week the user will want to see. But let's make this simple (for the moment).
How can I display the current week, which for us is Friday-Thursday?
Keeping in mind that a user might start their shift on a Thursday and end it on Friday morning.
So if a user is logged in on Thursday at 23:20hrs CST, they would still see the previous weeks schedule, but, at 00:01 Friday the new schedule would show up for the next week.
As far as the dailys go... This seems to me to be easier? If it's 06:00, 15:00, or 23:00 on Thursday or Monday of X date, should be straightforward to show the 'posts' for that day?
How can I display the current week, which for us is Friday-Thursday?
This will need to be completely custom because PHP defines a week as Sunday-Saturday.
At this point the custom code that is required to achieve the custom week is out of the scope of our support forum. I would recommend contact one of the registered contractors in order to get further assistance with this one. https://toolset.com/contractors/
Thanks,
Shane