Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to add time in blog post?

  • Avatar of bg
    bg
    Member

    @sobuddy

    Hi, I’m using child theme for the bp-default theme, but the default theme only shows the date in the blog post not the time. And I would like to add the time to it too how do I do it? I thank you in advance!

    My website is, http://buddygalaxy.com.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of Tammie
    Tammie
    Moderator

    @karmatosed

    The default theme uses http://codex.wordpress.org/Function_Reference/get_the_date so that would be a good spot for starting to modify that. It uses your set date and time format in WordPress under settings so you can modify that there and it will reflect on the theme.

    “Default: the date_format option (‘Date Format’ on Settings > General panel)”

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    or just pass a PHP date format to the function call in your blog post template, if you don’t want date format changing across the site.

    Avatar of bg
    bg
    Member

    @sobuddy

    Thanks to you both for the prompt responses! But, I can’t seem to find the exact file to modify the time or add the time code into it. I have also changed the time setting under General, but still only the date that shows, not the time?!

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    in bp-default single blog posts are displayed using single.php, and archive.php for the archive view

    Avatar of bg
    bg
    Member

    @sobuddy

    Thank you so much Roger Coathup! I could now make the time to show, although people have to click on the blog’s title first to read the rest of the blog before they could see the time. Anyway, it works! Thank you so much again. Take care!

    Avatar of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    thanks for the feedback — glad you got it working

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    @sobuddy you just add the WP template tag to show the time http://codex.wordpress.org/Template_Tags/the_time e.g. “

    Avatar of bg
    bg
    Member

    @sobuddy

    Thanks @mercime for your suggestion, but in which file should I add the time code because I don’t want to add it in the single.php file since it will only show up in single post. I want the time to show on the main blog page, so in which file should I modify? Beforehand Thanks!

    Avatar of bg
    bg
    Member

    @sobuddy

    I have sorted it out already. Anyway Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.