Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Column Last Post time format: min&hours move to day only


  • neon67
    Participant

    @neon67

    Please advise the correct way to Change Column Last Post time format: write only day instead of min & hours.
    – today
    – yesterday
    – 2 days ago…3…
    and so on … without minutes and hours.

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

  • wpturk
    Participant

    @wpturk

    You can remove everything between comma “,” and “ago” this way: (put in functions.php)

    function short_time ($output) {
        $output = preg_replace( '/, .*[^ago]/', ' ', $output );
        echo $output;
    }
    add_action ('bbp_get_time_since', 'short_time') ;

    neon67
    Participant

    @neon67

    Oh thanks. This is almost what I wanted.

    But instead of
    today – shown “no answers”
    yesterday – “1 day ago”
    …. where and that this changing?

    What mean —between comma “,” and “ago”—- this code slice: .*[^ago]/’ ..?


    neon67
    Participant

    @neon67

    Thanks everyone! Found a solution in the bbpress codeх


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar