Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to change Date and Time format


  • vincebalk
    Participant

    @vincebalk

    How can I change the format for all dates through the entire forum into j F Y in stead of the format used by bbPress?

    Which files do I have to change?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Change your WordPress settings (/wp-admin/options-general.php) to whatever format you require, bbPress will inherit those settings.


    vincebalk
    Participant

    @vincebalk

    Well, unfortunately it does not. I use multisite, does that matter?

    Settings are j F Y and H:i

    Lang is nl_NL / dutch;flemisch

    Can you try this instead 😉

    Either add this to your themes functions.php or your bbpress-functions.php or download the entire file and install it as a plugin from https://gist.github.com/ntwb/7767761

    add_filter ( 'bbp_get_reply_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
    add_filter ( 'bbp_get_topic_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
     
    function ntwb_bbpress_enable_date_translation( $result, $reply_id, $humanize, $gmt, $date, $time ) {
     
    	$date = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, $translate = true );
    	$result = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbpress' ), $date, $time );
    	return $result;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar