Home › Forums › Calendar Products › Events Calendar PRO › Remove Venue Link
- This topic has 4 replies, 3 voices, and was last updated 8 years, 2 months ago by Support Droid.
-
AuthorPosts
-
January 20, 2016 at 11:28 am #1059400rassakParticipant
Hi. I’d like to remove venue links all together, as I don’t want pages displaying for each venue. I saw there’s an old thread about this, in which it’s suggested that jQuery is added to the advanced template settings but it’s not working for me. Is there another way to achieve this?
Thanks!
January 20, 2016 at 11:00 pm #1059667CliffMemberHi. Thanks for your question.
I believe you’d need to reference our Themer’s Guide for such customizations.
But could you please provide links and screenshot mockups to help me understand what exactly you’re wanting removed and on which views and I’ll see if I can help?
Thank you.
January 21, 2016 at 12:22 pm #1060075rassakParticipantThanks, I can’t show you a link as it’s on my local but I’ve included screenshots highlighting the link I want to remove. I want the venue name to remain, but I don’t want it to link anywhere. Ideally I’d like to remove the venue page all together, but the next best thing is to remove all links to it. Right now I’m working in List view, but I’d like to disable the link across all views so the client has the freedom to switch between views in the future.
January 22, 2016 at 10:47 pm #1060795CliffMemberThanks. That helped a lot. Here are my thoughts:
1)
To still be able to use Venues for event information (i.e. enter data in wp-admin and display information/text on the front-end) but not let the links actually work, one idea is to use the ‘tribe_events_register_venue_type_args’ filter (found in /wp-content/plugins/the-events-calendar/src/Tribe/Main.php) to add
'publicly_queryable' => false,
to the list of arguments there (same source file). Here are the current arguments:/** * Args for venue post type * @var array */ public $postVenueTypeArgs = array( 'public' => false, 'rewrite' => array( 'slug' => 'venue', 'with_front' => false ), 'show_ui' => true, 'show_in_menu' => 0, 'supports' => array( 'title', 'editor' ), 'capability_type' => array( 'tribe_venue', 'tribe_venues' ), 'map_meta_cap' => true, 'exclude_from_search' => true, );
I tested adding publicly_queryable false to it and it made all single Venue pages (e.g. example.com/venue/your-venue-name) redirect to the site’s home page.
Reference: https://developer.wordpress.org/reference/functions/register_post_type/
2)
The second half of the issue is that we do not want the Venue’s name/title to link.
I believe you shared screenshots from both the Single Event Detail page view and the Event List archive view.
A)
For the Single Event Detail page view:
The free/core plugin displays the Venue name but doesn’t link it. With PRO add-on active, the Venue name gets linked (due to code in /wp-content/plugins/events-calendar-pro/src/Tribe/Single_Event_Meta.php)
Unfortunately, I didn’t see a way to easily disable PRO’s linking to the Single Venue Detail page.
One idea is to remove the link via jQuery. You could get the a element’s text (i.e. link anchor text) and replace the entire a element with its text (or possibly wrap in a span or div). This may help with part of that: http://stackoverflow.com/questions/18823065/how-can-i-get-the-text-inside-an-anchor-tag-in-jquery
Another idea is to not use any jQuery and just disguise the link. Technically, it could be clicked if you knew it was a link (and then it’d redirect you to the home page anyway), but something like this CSS would make it seem like there’s no link there:
body.single-tribe_events dd.tribe-venue a, body.single-tribe_events dd.tribe-venue a:hover, body.single-tribe_events dd.tribe-venue a:focus { text-decoration: none; border-bottom: none; cursor: default; color: black; }
B)
For the Event List archive view:
I tested with the Twenty Fifteen theme and there’s no link to the Venue (although it displays its information) so I’m not sure how to help with that one. Screenshot from my List view:
===
We don’t provide customizations as part of our Scope of Support Terms so I sure hope this helps you get you where you want to be in your customizations.
Please let me know how it goes for you! 🙂
February 19, 2016 at 8:35 am #1078192Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Remove Venue Link’ is closed to new replies.