Modern events calendar: change text

Hey there,
I’am using the german version of the plugin that comes with the theme. My problem is that it uses the wrong syntax for displaying the dates http://prntscr.com/n6b65z
Is there a way to get rid of the “th” and “st” etc. behind the numbers and change the word “für”?
Thanks for your help!

Hi @zerotoone.de,

Please try adding this custom JS under Theme Options > JS:

jQuery(document).ready(function($) {
	$('.mec-color.mec-table-side-day').each(function(index, el) {
		var text = $(this).text();

		$(this).text( text.trim().slice(0,-2) );
	});
});

Please add the following code under functions.php file locates in your child theme:

add_filter( 'gettext', 'x_edit_texts' );
function x_edit_texts($translation){
	$translation = str_ireplace('für', 'your text', $translation);
	return $translation;
}

Hope it helps :slight_smile:

what happens if I got a translation plugin? does this .js overwrite everything?

I think its easier to disable this elements http://prntscr.com/n6ct67
all together

Hi There @zerotoone.de

Yes, it may cause issues according to your customizations. I have checked your referenced link and it seems that you already hide those elements using custom CSS.

Thanks!

Is it the right way? just display:none; ?

Hello @zerotoone.de

Please be advised that this code is a PHP code that should be added in the child theme’s functions.php file

add_filter( 'gettext', 'x_edit_texts' );
function x_edit_texts($translation){
  $translation = str_ireplace('für', 'your text', $translation);
  return $translation;
}

Adding display:none; is correct way if you want to hide something from plain sight.

Hope this helps.

Thanks for your help!
how do I change the font size of this element? I could not find the class, but got it for the rest of the text


Thanks for your help!

Hi @zerotoone.de,

Please try adding this custom CSS:

article.mec-event-article .mec-event-time.mec-color {
    font-size: 24px;
}

Hope it helps :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.