Delete a comma

Home Forums Calendar Products Events Calendar PRO Delete a comma

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1069268
    Birgit Bauer
    Participant

    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/IEkgNjsSR

    Thank you for your help!

    #1069497
    George
    Participant

    Hey @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,
    George

    #1071885
    Birgit Bauer
    Participant

    Hello George,

    what about updates? Can I save this in my child theme to have it protected against updates?

    Or how can I protect it?

    #1072136
    George
    Participant

    Hi @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

    #1082897
    Support Droid
    Keymaster

    This 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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Delete a comma’ is closed to new replies.