Removing a prefix

Home Forums Welcome! Pre-Sales Questions Removing a prefix

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1356005
    Mateusz EM
    Guest

    Hi,

    How do I remove a prefix before a title?

    View post on imgur.com

    Sorry for my english.

    #1356566
    Geoff B.
    Member

    Good evening and welcome to the Events Calendar forum!

    Thank you for your interest in our products.
    We’ll be glad to answer your questions.

    To achieve this you simply need to customize our plugin language files.

    I highly recommend reading the 3 following articles on translation:

    The string you will want to change looks like “%1$s for %2$s”.

    As an alternative, some of our users prefer using a plugin such as Loco Translate for that purpose.

    You could also tweak and apply the following snippet in the functions.php file of your theme (without the PHP tag at the top): https://gist.github.com/andrasguseo/29903a974cb84060957881c17613c278

    Best regards,

    Geoff B.

    #1356636
    Mateusz EM
    Guest

    Thank you for your answer.

    Unfortunately, the method of translation by loco translate didn’t.

    I’m trying change functions.php but i don’t know which file to choose.
    Main theme file “functions.php” or file in /plugins/the-events-calendar/funtions.php?

    #1356997
    Geoff B.
    Member

    Good afternoon,

    Thank you for writing back.

    The functions.php to modify is your theme’s (not our plugin’s).
    2 words of cautions though:

    1. Do NOT include the snippet’s opening <? PHP part in your functions file (there should already be one in place)
    2. Please use FTP or File manager to modify your functions.php file. This way if something goes wrong, you can roll back.

    Have a good weekend,

    Geoff B.

    #1357595
    Mateusz EM
    Guest

    Hi,

    I’m adding code in functions.php and nothing happens.

    add_filter('loop_shop_columns', 'loop_columns');
    
    function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) {
     
    	// Put your custom text here in a key => value pair
    	// Example: 'Text you want to change' => 'This is what it will be changed to'
    	// The text you want to change is the key, and it is case-sensitive
    	// The text you want to change it to is the value
    	// You can freely add or remove key => values, but make sure to separate them with a comma
    	// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
    	$custom_text = array(
    		'for' => '-',
    	);
    	
    	// If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
        	if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
    		$translation = $custom_text[$translation];
    	}
        return $translation;
    }
    add_filter('gettext_with_context', 'tribe_custom_theme_text_with_context', 21, 4);
    #1357604
    Mateusz EM
    Guest

    Succeeded!
    I edited file loop.php.

    Thanks for help!

    #1358123
    Geoff B.
    Member

    Good evening,

    I am super glad that you were able to get this to work for you!
    Well played.

    You are welcome back in our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Removing a prefix’ is closed to new replies.