Home › Forums › Calendar Products › Events Calendar PRO › Delete a comma
- This topic has 4 replies, 3 voices, and was last updated 8 years, 2 months ago by Support Droid.
-
AuthorPosts
-
February 8, 2016 at 5:23 am #1069268Birgit BauerParticipant
Hello,
I want to do one little fix but can’t find where to do the change.
Because we handle addresses in Austria different than you do in America, I changed the use of the fields of the plugins.
Now it looks like I would like to have it except a comma which is displayed behind the name of the city (Brunn). Where/how can I delete this comma on the single event pages?
Here is a screenshot:
http://screencast.com/t/IEkgNjsSRThank you for your help!
February 8, 2016 at 7:24 am #1069497GeorgeParticipantHey @Birgit,
Deleting that comma is unfortunately a quite-involved customization to make at this time. We are hoping to simplify this in the future, but for now you have to edit core plugin files directly.
To get started, head to your plugin files for The Events Calendar and navigate to this file:
/src/Tribe/Main.php
Find the function called fullAddressString()–it’s quite far down the file, around line 2916 or so. Here’s a screenshot of this function:
Change this block of code:
if ( tribe_get_city( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}$address .= tribe_get_city( $postId );
}
To this:
if ( tribe_get_city( $postId ) ) {
$address .= tribe_get_city( $postId );
}
That might help; if it’s not the right comma, then undo that change and then try removing commas from the other blocks in that function.
Tinker around with this a bit and I’m sure you’ll be able to get things looking just how you hope.
Best of luck with your customizations,
GeorgeFebruary 12, 2016 at 4:08 am #1071885Birgit BauerParticipantHello George,
what about updates? Can I save this in my child theme to have it protected against updates?
Or how can I protect it?
February 12, 2016 at 7:19 am #1072136GeorgeParticipantHi @Birgit,
Putting your customizations in a Child Theme is indeed an excellent way to make the customizations, and should indeed allow you to update the plugins and the “parent theme” without losing the custom code.
I hope that helps!
– George
February 27, 2016 at 8:35 am #1082897Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Delete a comma’ is closed to new replies.