Home › Forums › Calendar Products › Events Calendar PRO › Shortening or Adjusting Event Website URL
- This topic has 7 replies, 3 voices, and was last updated 7 years, 11 months ago by Cliff.
-
AuthorPosts
-
May 31, 2016 at 3:57 pm #1120945ariddlelfccParticipant
Hi. I have a college department that uses this plugin to post events for their classes. Their event’s website field they use to link to the company page where someone can register for that particular event.
For example, with this class:
https://lfccworkforce.com/event/eetc-certification-exam-for-power-equipment-electrical-systems-2/
The website URL is this: https://lordfairfax.augusoft.net/index.cfm?method=ClassInfo.ClassInformation&int_class_id=38309&int_category_id=3&int_sub_category_id=95&fromRpt=1
Is there a way to shorten that website URL or have it say “Click here to register” and have it still point to the given URL? The issue is the URL is very long and flowing into other parts of the event listing…and it also does not translate well on a mobile device.
Also, as an added bit of info, we are using the bulk import feature to list the classes as events.
Thank you or the help!
June 1, 2016 at 5:37 am #1121093CliffMemberHi. Thanks for your detailed question.
You’ll want to use our Themer’s Guide to copy the file at /wp-content/plugins/the-events-calendar/src/views/modules/meta/details.php to [your-child-theme]/tribe-events/modules/meta/details.php and replace this section of code:
<?php // Event Website if ( ! empty( $website ) ) : ?> <dt> <?php esc_html_e( 'Website:', 'the-events-calendar' ) ?> </dt> <dd class="tribe-events-event-url"> <?php echo $website; ?> </dd> <?php endif ?>
You’ll want to create your own HTML link with that $website variable.
June 1, 2016 at 6:50 am #1121114ariddlelfccParticipantHi. Thanks for the help! I tried this out and am able to modify the URL to read as “REGISTER NOW”, however it is picking up the full URL of the current website and the register now link.
It is leading to this:
I need the initial URL not to be included and removed:
Here is the code I have so far:
<?php
// Event Website
if ( ! empty( $website ) ) : ?><dt> <?php esc_html_e( ‘Website:’, ‘the-events-calendar’ ) ?> </dt>
<dd class=”tribe-events-event-url”> <?php echo “REGISTER NOW” ?> </dd>
<?php endif ?>June 1, 2016 at 6:53 am #1121117ariddlelfccParticipant<?php // Event Website if ( ! empty( $website ) ) : ?> <dt> <?php esc_html_e( 'Website:', 'the-events-calendar' ) ?> </dt> <dd class="tribe-events-event-url"> <?php echo "<a href='$website'>REGISTER NOW</a>" ?> </dd> <?php endif ?>
- This reply was modified 7 years, 11 months ago by ariddlelfcc.
June 1, 2016 at 10:11 am #1121269CliffMemberMy apologies. The $website variable is the full HTML already, not the raw URL.
You can get the raw URL from
tribe_get_event_website_url( $event_id )
I hope that helps!
June 1, 2016 at 11:41 am #1121310ariddlelfccParticipantThanks! This article actually helped me accomplish what I needed:
https://theeventscalendar.com/knowledgebase/url-as-word-button/
June 1, 2016 at 3:49 pm #1121412CliffMemberThanks for letting me know! I am glad you got it figured out. 🙂
-
AuthorPosts
- The topic ‘Shortening or Adjusting Event Website URL’ is closed to new replies.