I am trying to create a plugin which translates wordpress blog month name from english to german i am using divi theme so far i have added
<?php
/* Plugin Name: German Months Description: Translate Blog Month Names to German Version: 1.0 */
error_reporting(E_ALL);
function german_month_plugin_menu() { add_menu_page( 'German Month Plugin Settings', 'German Month', 'manage_options', 'german-month-plugin', 'german_month_plugin_page', ); }
add_action('admin_menu', 'german_month_plugin_menu');
function translate_month_to_german($date) {
$german_months = array(
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
);
$date = strftime('%B', strtotime($date));
$date = str_replace($date, $german_months[intval(date('n', strtotime($date))) - 1], $date);
return $date;
}
add_filter('the_date', 'translate_month_to_german'); add_filter('get_the_date', 'translate_month_to_german');
?>
above code is working on wordpress default theme but not working on divi can someone help me why this hapening ?