Skip to:
Content
Pages
Categories
Search
Top
Bottom

use bp_core_time_since() in blog pages


  • hamedhemmati
    Participant

    @hamedhemmati

    How can I use the relative time buddypress uses in the blog pages. I know bp_core_time_since() converts the time to relative time and I would like to show the same time format for my blog posts on the index.php and single.php but I can’t figure out how to use this function. I tried bp_core_time_since(the_date()) but still just shows the date.

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

  • hamedhemmati
    Participant

    @hamedhemmati

    Does anyone know how to do this?


    Boone Gorges
    Keymaster

    @boonebgorges

    This is just off the top of my head, but try `echo bp_core_time_since( strtotime( get_the_date() ) );`


    hamedhemmati
    Participant

    @hamedhemmati

    awesome! Thanks Boone that worked perfectly.


    hamedhemmati
    Participant

    @hamedhemmati

    One other question about time since can bp_message_thread_last_post_date() be converted to a time since format as well? I tried replacing it with bp_the_thread_message_time_since() but it says 11 years, 5 months ago.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘use bp_core_time_since() in blog pages’ is closed to new replies.
Skip to toolbar