Home › Forums › Calendar Products › Events Calendar PRO › Make other Website URLs a linked word or button
- This topic has 12 replies, 4 voices, and was last updated 7 years, 5 months ago by Monica Filos.
-
AuthorPosts
-
October 24, 2016 at 4:53 am #1181815Monica FilosParticipant
Hi, I was able to work a button for the event website url following the instructions on this page:
https://theeventscalendar.com/knowledgebase/url-as-word-button/But now I need to make similar buttons for the organizer and venue website urls as well. Is it a matter of repeating the same snippet but replacing the field name? and if so, could you please tell me what the names of such fields are so I can proceed from there?
Thanks,
MoniqueOctober 24, 2016 at 6:40 pm #1182230CliffMemberHi Monica.
You can use the tribe_get_organizer_website_link_label and tribe_get_venue_website_link_label hooks for Organizers and Venues.
You’ll need to do a bit of other editing but that should get you started.
If you can’t get it, please share what code you come up with and I’ll take a look and try to fix it for you.
October 26, 2016 at 5:40 am #1183107Monica FilosParticipantHi Cliff,
Thank you, that did it and I was able to replace the text for the button. Now, where and how do I remove the “Website” remaining headings?Following the initial tutorial (https://theeventscalendar.com/knowledgebase/url-as-word-button/), I was able to do that for the main page website label following these instructions:
Make a copy of the details.php file. It is located in /plugins/the-events-calendar/src/views/modules/meta/details.php.
Make a new folder in your theme directory called tribe-events
Make a new folder in that one called modules
Make a new folder in that one called meta
Drop the copied details.php file in that last folder
Now that the template is in the theme, it can be customized to suit your needs. In this case, remove the following line from the template (at time of this writing, it’s in line 148):<dt> <?php esc_html_e( ‘Website:’, ‘the-events-calendar’ ) ?> </dt>
Could you please tell me the filename and lines I need to remove to do the same for both organizer and venue?
I dont want to mess it up 😉
Thank you and regards,
MoniqueOctober 26, 2016 at 10:24 am #1183299CliffMemberMonique, thanks for your detailed question.
You’ve got it.
It’s a similar process for organizer.php and venue.php in those same directories.
Please let me know how it goes for you.
October 26, 2016 at 2:39 pm #1183424Monica FilosParticipantHi Cliff, check the following images:
Buttons01: BLISS… THANK YOU!!!
Buttons02: ALMOST BLISS… how do I make the word “Teléfono:” to get displayed before the phone number and “Dirección” which stands for address before the address? (interestingly enough, for the organizer, it does it!
Buttons03: Functional but not a bliss… yet!!! Looks jammed! How do I make it look like Buttons02, including the phone label feature asked for image Buttons02? And also the words “Correo electrónico:” which stands for email in Spanish before the email?I also noticed that for the organizer there is no google map option… that´s ok but it would have been nice.
Regards,
Monique- This reply was modified 7 years, 6 months ago by Monica Filos.
- This reply was modified 7 years, 6 months ago by Monica Filos.
October 26, 2016 at 7:36 pm #1183519CliffMemberI’m glad you’re making progress.
For spacing, I believe you’ll need to make such customizations via CSS. If you provide me the link to a single event and tell me what you want, I should be able to get you started in the right direction.
Location functionality is only available for Venues, not Events or Organizers. Although a longshot, if desired, you could request this as a new feature (or maybe search to see if the idea was already posted by someone else) at our plugins’ UserVoice page.
This allows others who are interested in that feature to easily voice their support. We frequently review suggestions there to find out which ones are popular, then we implement as many of them as we can.
If you post it / find it, feel free to link to it from here in case anyone comes across this forum thread in the future.
November 7, 2016 at 5:37 pm #1188880Sarah CardellaParticipantI was wondering if you could help me with this exact same issue? I’ve gotten the Event Website URL to display a “View Website” link just fine, but I’m having trouble with the Organizer and Venue links displaying as a “View Website” link. If you can point me in the right direction, I’d really appreciate it. Here’s the code I’m using for the three different links. All of this is in my functions.php file.
//Change Event URL to linked word instead of showing long URL add_filter('tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default'); function tribe_get_event_website_link_label_default ($label) { if( $label == tribe_get_event_website_url() ) { $label = "Visit Website »"; } return '<a href="' . tribe_get_event_website_url() . '">' . $label . ' </a>'; } //Change Organizer URL to linked word instead of showing long URL add_filter('tribe_get_organizer_website_link_label', 'tribe_get_organizer_website_link_label_default'); function tribe_get_organizer_website_link_label_default ($label) { if( $label == tribe_get_organizer_website_url() ) { $label = "Visit Website »"; } return '<a href="' . tribe_get_organizer_website_url() . '">' . $label . ' </a>'; } //Change Venue URL to linked word instead of showing long URL add_filter('tribe_get_venue_website_link_label', 'tribe_get_venue_website_link_label_default'); function tribe_get_venue_website_link_label_default ($label) { if( $label == tribe_get_venue_website_url() ) { $label = "Visit Website »"; } return '<a href="' . tribe_get_venue_website_url() . '">' . $label . ' </a>'; }
Can you let me know what I’m doing wrong in the Organizer and Venue snippets above?
Thanks!
November 8, 2016 at 3:04 pm #1189369CliffMemberPluto, thanks for sharing your code snippet. It works just fine for me:
- without custom code: https://cl.ly/41043L2X1g43
- with custom code: https://cl.ly/2a2R2J3b410S
If you need further assistance, please create your own thread.
Monica, please let me know if you need any further help here as well.
Please note that threads get Closed automatically after a couple weeks of inactivity. If it does get Closed, please open a new thread, adding your current problem description and also linking back to this thread.
Thank you!
November 9, 2016 at 8:17 am #1189639Monica FilosParticipantHi Cliff, the url to one of the locations would be http://www.sustanciainfinita.com/ubicacion/hotel-doubletree-by-hilton/
Right after the website button begins the address and phone number and I would like to add the words Address and Phone number before each one and to also have each (address and phone number) to be on its own line and not altogether.
Regards,
MoniqueNovember 9, 2016 at 9:42 am #1189769CliffMemberMonica, I believe you’d need to reference the Themer’s Guide and override this file:
/wp-content/plugins/events-calendar-pro/src/views/pro/single-venue.php
Please let me know if you have any follow-up questions on this topic.
November 9, 2016 at 11:02 am #1189834Monica FilosParticipantBliss!!!! Took me a couple of minutes to figure the styling because the class factor comes from another place but Im becoming a pro thanks to you hahaha… YOU RULE!!!
November 9, 2016 at 1:10 pm #1189925CliffMemberI’m very glad to hear that. 🙂
-
AuthorPosts
- The topic ‘Make other Website URLs a linked word or button’ is closed to new replies.