[Plugin: Simple Timed Content] Trying to use a php variable to calcualat ondate … not working.
I have the execphp plugin installed and am able to run php in a post. I have installed the simple timed conetent plugin and am attempting to insert a variable into the plugin so that I will not have to calculate the show date of content in a multitude of similar posts.
For example, I have season content that will be released on a different day each month during the month after the post is published. One post in January, another post in February, and so forth throughout the year.
The following code calculates the date, but the shortcode does not hide the content during the period between publication and the desired show date.
<?php $showdate_10 = get_the_date('U') + (60 * 60 * 24 * 10); $ondate_10 = date('Y-m-d', $showdate_10); ?> [timed ondate="<?php $ondate_10; ?>"]This link should appear ten days after publication, on <?php echo $ondate_10; ?>. If you can see it before then, something is not working.[/timed]
I have tried using both double quotes, and single quotes to wrap the variable in within the shortcode, but neither worked. Any suggestions?
- The topic ‘[Plugin: Simple Timed Content] Trying to use a php variable to calcualat ondate … not working.’ is closed to new replies.