how can i implement this?
-
This is an example shortcode:
[jcountdown timetext=”2015/8/1 15:31:20″ timezone=”1″ style=”flip” color=”black” width=”0″ textgroupspace=”6″ textspace=”0″ reflection=”false” reflectionopacity=”10″ reflectionblur=”0″ daytextnumber=”3″ displayday=”false” displayhour=”true” displayminute=”true” displaysecond=”true” displaylabel=”true” onfinishredirecturl=”http%3a%2f%2flocalhost%2f”]2015/8/1 15:31:20[/jcountdown]
And I need to get the expiry date from a custom field, this can be done with the following code:
get_post_meta(get_the_ID(), “clpr_expire_date”, true);
In fact to me more specific to pass such custom field value to an external variable, you can do this:
<?php
$expiryDATE = get_post_meta(get_the_ID(), “clpr_expire_date”, true);
echo ‘Expiry date : ‘.$expiryDATE;
?>
Example Output>> Expiry date : 2014-12-31Now as I’m not a programmer, the following code does not seem to work, can you help me get this to work, step by step?
<script type=”text/javascript”>
$expiryDATE = get_post_meta(get_the_ID(), “clpr_expire_date”, true);
</script>
[jcountdown timetext=$expiryDATE” 15:31:20″ timezone=”1″ style=”flip” color=”black” width=”0″ textgroupspace=”6″ textspace=”0″ reflection=”false” reflectionopacity=”10″ reflectionblur=”0″ daytextnumber=”3″ displayday=”false” displayhour=”true” displayminute=”true” displaysecond=”true” displaylabel=”true” onfinishredirecturl=”http%3a%2f%2flocalhost%2f”]2015/8/1 15:31:20[/jcountdown]Another thing i have a third party plugin installed called php widget, so i could execute php code in a widget if is needed.
Thank You
- The topic ‘how can i implement this?’ is closed to new replies.