Forum Replies Created
-
AuthorPosts
-
July 10, 2012 at 10:52 am in reply to: Need to remove United States / country from list and single view pages #21873
Kym
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.
April 26, 2012 at 7:48 pm in reply to: Need to remove United States / country from list and single view pages #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 24, 2012 at 12:28 am in reply to: Need to remove United States / country from list and single view pages #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 23, 2012 at 10:10 am in reply to: Need to remove United States / country from list and single view pages #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 22, 2012 at 10:25 pm in reply to: Need to remove United States / country from list and single view pages #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 22, 2012 at 10:21 pm in reply to: Need to remove United States / country from list and single view pages #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:15 pm in reply to: Need to remove United States / country from list and single view pages #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 11, 2012 at 11:40 am in reply to: Help with Additional Fields – links, and display on Event List page #17823Kym
ParticipantAmanda – I second that feature request. That would be awesome. If I can add to that:
My client’s situation is that they would like a “To Register” custom field. Usually, that would be a link to the registration page, which is what I’m using the code generated above for. BUT, there are some cases where an event they are posting does NOT have a registration link. Some events say “To register, call 555-555-5555” or “Registration Not Required.” Using the code Jonah provided works perfectly when there’s a link, but now, for events with no link, a completely different custom field must be used.If Amanda’s suggestion could be implemented, I’d put a twist on it like this: it would be cool if I can add “Registration information” custom field. In the value box, we would type either “Click here to register” or “Call 555-555-5555 to register.” THEN, for the case of “Click here to register” there would then be a checkbox for link, and a separate value field where a URL could be entered. That would solve the problem of wanting to hide the actual URL and create your own linked text.
🙂April 9, 2012 at 10:41 pm in reply to: Help with Additional Fields – links, and display on Event List page #17762Kym
ParticipantThank you Jonah – you are very, very helpful! I will give this a try. Thanks!!
April 8, 2012 at 9:21 pm in reply to: Help with Additional Fields – links, and display on Event List page #17726Kym
Participanthi Jonah!
For some reason I never got an email that my question was answered… just seeing your response now. You are my hero! Thank you so much.I do have another question now though…
I added the code to the single.php page as you suggested, tweaked the placement and style to suit my needs. The one thing I can’t figure out though: right now, the code calls in tribe_get_custom_field(‘Registration Link’) which displays my “Register Now” link. It is ALSO displaying ALL of my custom fields through tribe_the_custom_fields. So, on one line it is displaying the text-only version of my registration link, and then under that it displays the new output I created for Click Here to Register Now.
Is there a way to prevent tribe_the_custom_fields from displaying any output for a SINGLE custom field? I do not want to simply remove that line of code, as there are other custom fields that I would like to continue to display. I just don’t want the custom field for the registration link to display. I do realize I could remove that line, then hard-code in each individual custom field, but I don’t want to take away the ability for my client to add additional fields in the future.
Once again, I am so grateful for your help! Thank you!
Kym
ParticipantHm, I’m feeling pretty smart tonight. I sat and thought about the error and then realized that the issue must have been that the theme was developed before post_thumbnails was introduced, and sure enough it was. Added add_theme_support(‘post-thumbnails’); to functions.php and everything is working fine, it appears. All resolved.
-
AuthorPosts
