Post visibility control, future
-
I’m trying to provide my users with the ability to see a post in advance. If a post is for Feb 29, I want them to be able to see it at a certain time on Feb 28 (say, 7pm). This is for a fitness website where people like to see the workout for tomorrow.
I don’t know if the best place to do this is in pre_get_posts and I’ve tried it there but my php knowledge is limited (Java I’d be fine) and I’m getting errors left, right and center. I’ve tried the date_query but again I don’t think my syntax is correct and I don’t have it here to put up for inspection. Any functioning script kiddie post would be great for me right now 🙂
from memory it is something similar to
— check for main query and appropriate category —
$today = getToday();
$date_query = array(‘before’=>array(‘year’=>$today(“year”),
‘month’=>$today(“month”),
‘day’=>$today(“mday”)+1),
‘inclusive’=>true)mainQuery-set=>’dateQuery’ = $date_query;
yes I’m aware that the syntax is off but I’m no where near it so please don’t fry me 🙂
On another note is there a way to sandbox the wordpress instance so I don’t take down the entire sight while I play around with it?
Thanks and I’d appreciate any help
Andy
The topic ‘Post visibility control, future’ is closed to new replies.