Skip to:
Content
Pages
Categories
Search
Top
Bottom

how can I change x “days” ago


  • Ole
    Participant

    @olpo24

    Hi,

    I want to change generally all x days (years, whatever) ago to german like “vor x Tagen”.

    I Have found the code base in inludes/commeons/formatting.php.
    But I’m not so goog in develeoping.
    Can somebaody help me please?

    Kind regards,
    Ole

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

  • Robin W
    Moderator

    @robin-w

    In bbpress 2.6.x the date freshness format has changed.
    If your translation has not been updated this will still display in English.

    install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Freshness Display

    and you will be able to enter translations there


    Ole
    Participant

    @olpo24

    Hi Robin,

    thank for reply.
    I Know your plugin.
    The problem is, it seems not to be compatible witz GD Quatum Theme from dev4press.

    I the moment when activating your plugin, the layout of the forum is broken.

    Kind regards,
    Ole


    Robin W
    Moderator

    @robin-w

    ok, try this

    add_filter ('bbp_get_time_since' , 'rew_time_since_translate' ) ;
    		
    	
    	function rew_time_since_translate ($output) {
    		$output = preg_replace('/years/', 'new word', $output);
    		$output = preg_replace('/year/', 'new word', $output);
    		$output = preg_replace('/days/', 'new word', $output);
    		$output = preg_replace('/day/', 'new word', $output);
    		
    		return $output ;
    	}

    so change ‘new word’ in each case for what you want to show

    you can add as many lines as you need, but always do the plural first so ‘years’ followed by ‘year’

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    Ole
    Participant

    @olpo24

    Thank you, but this change nothing.


    Robin W
    Moderator

    @robin-w

    so can you post the exact code you tried, and say where you put it

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