• Resolved SWC76801

    (@swc76801)


    I am wanting to display the current date within a static post on my blog. I’ve tried php and java but haven’t had any luck.

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Try something like:
    <?php echo date('F j, Y');?>

    https://uk3.php.net/manual/en/function.date.php

    Thread Starter SWC76801

    (@swc76801)

    I tried the code but nothing displays in the post. After thinking about this over night, I’m beginning to think that it would be better if I could have the date of the static post change dynamically to the current date. The URL for the post is I’m using the static post to present a daily forecast showing the best fishing times for Lake Brownwood. The data in the chart is being pulled from another website.

    A secondary problem I’m having is formatting the table used to present the chart. There is a white space between the chart and the dates that I’d like to remove. I can’t figure out what I’ve got wrong.

    The code for the post is:

    [Code moderated as per the Forum Rules]

    MichaelH

    (@michaelh)

    Look at using a plugin such as https://www.ads-software.com/extend/plugins/exec-php/ so you can put PHP code such as <?php echo date('F j, Y');?> in a post and/or page.

    You might also want to start another topic about your ‘tables’ and place any code in a paste bin such as wordpress.pastebin.com and report the link in your new thread.

    [edit fixed pastebin ref]

    Thread Starter SWC76801

    (@swc76801)

    Thanks for the plugin! It worked perfectly and my problem is now solved! I appreciate everyone’s assistance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Display Current Date Within a Post’ is closed to new replies.