Home › Forums › Calendar Products › Events Calendar PRO › Need to remove United States / country from list and single view pages
- This topic has 17 replies, 6 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
April 16, 2012 at 9:29 am #17947
Kym
ParticipantI erroneously posted this yesterday to the wrong forum, reposting here…
Hello β
I searched and found a couple others with this problem, but no solution that will work for me. Particularly, this thread: https://theeventscalendar.com/support/forums/topic/modify-venue-options/#post-14667
Jen detailed the problem word-for-word what my issue is. Sadly, her solution for some reason did not work for me. I added the function to functions.php and modified my copies of single and single-venue, to no avail.Anyone else have a fix for me? This installation of Pro is for a client and they are insistent that the country not display. Since I already created the venue with a country, I canβt get rid of it, and even when I try to add a new venue, United States is automatically selected and I canβt get rid of it.
Heeelpppp
Kym
April 16, 2012 at 6:00 pm #17963Rob
MemberHey Kym. Thanks for reaching out here. Any chance you can revert to the 2011 theme, try Jen’s suggestion there and see if it works? I’m wondering if the limitation is one specific to the theme…
Also, regarding the venue: what happens if you go to the “Venues” option in your left-hand admin sidebar on the backend, and remove the country from there (then save)? Changes made to existing venues should be back-populated to any existing event tied to that venue.
Let me know how that goes and I’ll do what I can to assist from there.
April 22, 2012 at 10:15 pm #18120Kym
ParticipantHi Rob,
Thanks for the reply.
Let me start with your second suggestion. I don’t mean to sound dense… but how can I remove the country from the venue? I know other people posted in this forum about the same problem… once you set a venue, you cannot remove it. It displays in a drop-down, and there is no “blank” option in the drop-down options. So once you pick one, you cannot delete it or set it to “no country.” Am I missing something?
Furthermore… I fear that even if it could be removed, it wouldn’t work. For the state drop-down, there is a “Select State” option. So after I set my venue to Pennsylvania, it IS possible to remove Pennsylvania by clicking on Select State. However, when I did that (just to see what would happen) and then viewed all of my events at that venue, they still show Pennsylvania in the address…. so removing the state did not do anything.If you do not experience the same as what I am explaining, or would like more info to help debug what’s happening, I would be happy to help more…
Back to your first comment, about reverting to the 2011 theme. I am always VERY wary of changing themes, as widget data can be trashed when you do that. So I would need to install a copy of the site on my testing server to try that. If I have the time I will. But I would love it if we could find the core problem of why you cannot remove a country from the venue or prevent the display of a country, if possible, rather than add code anyway…
Looking forward to your response/thoughts…
April 22, 2012 at 10:21 pm #18122Kym
ParticipantRob – further info… I cannot even create a NEW venue to replace the old ones. When I click on “Add New Venue” the Country field is already pre-populated with “United States” and as stated above, unless I change it to another country, it cannot be removed.
April 22, 2012 at 10:25 pm #18123Kym
ParticipantMe again. This is strange. I decided to delete ALL venues completely, thinking that would surely allow me to create a new venue without a country default listing. No, it didn’t. But even stranger – there are now no venues listed in my Venues list, but yet when I try to add a new venue, the Address, City, Country, and Postal Code are all pre-filled with one of our venues. Where is it pulling that data from – why would it have a “default” venue that it’s pulling from if I deleted all my venues?
April 23, 2012 at 9:30 am #18165Jonah
ParticipantHi Kym, it sounds like there are three issues here:
1. There is no null option for the venue Country select.
2. Removing Venues did not seem to really remove them.
3. The custom tribe_address_exists() function did not work for you.Let me try and address these.
1. Joey stated in the referenced thread that this will be modified in 2.1 to allow for a null option. I’m going to amend it to also include the state drop down. Currently there is no fix for this unless you hack the core but we don’t want to do that…
2. I just tested deleting all my Venues and when I did, they we’re really gone. Make sure you empty the trash, etc. When you go to create a new Venue, you will still see the Country drop down defaulting to United States but there is no way around this currently.
3. The custom tribe_address_exists() function should work for you but be sure you added your custom function in the proper template files to override the default tribe_address_exists() function.
I hope that answers your questions, but let me know if you have any more or still need help with this.
April 23, 2012 at 10:10 am #18177Kym
ParticipantHi Jonah,
Thanks for the reply. It would be great if a null option for Country could be added that would cause no country to display at all – perfect, ideal! (same for state).
In the meantime, addressing #2: I didn’t remove my venues from the trash, maybe that was the problem. But once they were all gone and said “no saved venues” on a create new event page, the address from our main venue still automatically filled in the venue spot, which was weird. However, it doesn’t really matter, because as you said, “united States” will still default, and I can’t get rid of it, so no sense in trying to delete the venues again.As for the custom tribe_address_exists() function, I will try again following step by step what Jen outlined. Will let you know how I make out. I’m pretty sure I added everything correctly the first time, but mistakes happen so let me try again.
Thanks!
April 23, 2012 at 10:54 am #18187Jonah
ParticipantHi Kym, sounds good. Make sure you are making a custom tribe_address_exists function (custom_tribe_address_exists() would be fine) and you are adding it in the templates where needed and you are overriding the templates (placing copies in an ‘events’ folder in your theme) and not modifying the core templates.
April 24, 2012 at 12:28 am #18231Kym
ParticipantOK… so this just isn’t working for me…
Here is what I did:
1. I made a copy of single-venue.php and put it in my /events/ folder where my other event templates are. (I also have copies of single.php and list.php but I will just use single-venue.php as my example for now.)
2. I opened my functions.php file and copied Jen’s code exactly, as follows:
function custom_tribe_address_exists( $postId = null ) {
if (
tribe_get_address( $postId ) ||
tribe_get_city( $postId ) ||
tribe_get_region( $postId ) ||
tribe_get_zip( $postId )
) {
return true;
} else {
return false;
}
}I added this to the bottom of my functions.php file (but yes, contained within the php tags).
3. I then opened single-venue.php and replaced the single instance of “tribe_address_exists” with “custom_tribe_address_exists” as she instructed. See code here: http://pastebin.com/X4rDFKPV
That should result in the country removed from the Venues, page, yes? It does not, as you can see here: http://www.vfes.net/venue/vfe
Admittedly, I am not a programmer so while I can make my way around PHP and WordPress code, I’m by far no expert. But it seems to me that the value I should be amending is tribe_get_full_address, wouldn’t it be? Regardless, I’m very open to any suggestions why this isn’t working for me…
Thanks!
April 24, 2012 at 5:20 pm #18253Jonah
ParticipantHi Kym, I’m very sorry but somehow I completely botched this. To actually affect the display, you need to modify the /views/full-address.php template. This is what’s used to display the address in both the single venues and single events. The tribe_address_exists() function just checks to see whether or not address values exist and if they do it executes the code below, i.e. executing tribe_get_full_address(); which eventually spits out the code in the full-address.php template.
So, all you should need to do is make a copy of full-address.php and place in the ‘events’ folder in your theme and remove the country code in the template.
I hope that finally answers your question and again I’m sorry for not being more attentive to the issue at hand. It’s strange because I did test creating the custom function myself and it seemed to work but my eyes must have deceived me!
April 26, 2012 at 7:48 pm #18352Kym
ParticipantJonah – thank you thank you!! π
That’s exactly what I was looking for… just had no idea where to look for it! You are my hero today, and no problem it took us a bit to get to it. πThanks thanks thanks! Hope this helps others too!
Kym
April 27, 2012 at 8:53 am #18360Jonah
ParticipantAwesome to hear Kym! Let us know if there’s anything else we can help with π
July 10, 2012 at 9:43 am #21867Anderson
ParticipantI need to do this very same thing but am not able to find the /views/full-address.php template. Perhaps it has changed in a later version. There are three files in “views”: “single-venue.php” plus two widget display files. Where can I comment out the country code?
July 10, 2012 at 10:52 am #21873Kym
ParticipantHi Krysia,
I had the same problem too… you’re looking in the wrong folder. There are two folders under the /plugins directory. One is /the-events-calendar/ and the other is /events-calendar-pro/. You’re looking in the /events-calendar-pro/ folder; you want to look in the /the-events-calendar/ directory.Hope that helps.
July 10, 2012 at 11:42 am #21876Anderson
ParticipantDear Kym — I found it! Problem is, it doesn’t seem to work. Did you just copy it into your theme “events” directory and edit? Not sure why this isn’t working for me.
-
AuthorPosts
- The topic ‘Need to remove United States / country from list and single view pages’ is closed to new replies.
