Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to add time in blog post?

  • @sobuddy

    Member

    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)
  • @karmatosed

    Moderator

    The default theme uses https://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)”

    @rogercoathup

    Participant

    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.

    @sobuddy

    Member

    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?!

    @rogercoathup

    Participant

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

    @sobuddy

    Member

    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!

    @rogercoathup

    Participant

    thanks for the feedback — glad you got it working

    @mercime

    Participant

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

    @sobuddy

    Member

    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!

    @sobuddy

    Member

    I have sorted it out already. Anyway Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] How to add time in blog post?’ is closed to new replies.
Skip to toolbar