Support » Plugin: The Events Calendar » Replace event link on calendar by link from custom field in event page

  • Resolved jejemo

    (@jejemo)


    Hello there,

    I know i’m trying to do something weird here. I did not find anything about this anywhere so I’m putting it here :

    I would like to replace events links on the calendar by a specific link I have in a custom field in events pages.

    I don’t use event pages, I want to link an event to a specific page somewhere else.

    Do you think that’s something the-events-calendar can do ?

    By advance thanks a lot !

    jejemo

    https://wordpress.org/plugins/the-events-calendar/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi jejemo,

    To achieve this please try adding the following code in the functions.php file of your child theme

    function custom_tribe_event_link( $Link, $event){
    	if(function_exists('tribe_is_event_query') && tribe_is_event_query()){
    		$custom_link = get_post_meta($event->ID, 'custom-link', true);
    		if( $custom_link ){
    			return $custom_link;
    		}
    	}
    	return $Link;
    }
    add_filter('tribe_get_event_link', 'custom_tribe_event_link', 10, 2);

    After adding this code add the custom link in the event page whatever you want to use but make sure to name the custom field as custom-link

    Best Regards,
    Vinod Dalvi

    Plugin Contributor leahkoerper

    (@leahkoerper)

    Thanks Vinod!

    jejemo, did that work for you? We’re not able to assist with customizations like this on the forum, but hopefully Vinod’s idea will get you set. Here are some further resources that might be helpful:

    Themer’s Guide – provides an overview of how to customize the plugin’s frontend appearance.
    Tutorials – useful tips and tricks for changing how the plugin looks and behaves.
    Technical Docs – provides an overview of the classes and functions in each plugin

    Good luck, and thanks for using The Events Calendar!

    ~Leah

    Thread Starter jejemo

    (@jejemo)

    Hello,

    I had to find another solution before I could try Vinod’s solution.

    So I’m using another plugin, lighter for what I want to do.

    Thanks for the answers.

    jejemo

    Hi Jejemo,

    Great to see you found the another solution to achieve it.

    If I can be of any further assistance please don’t hesitate to ask 🙂

    Have a great day..!!

    Cheers,
    Vinod Dalvi

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replace event link on calendar by link from custom field in event page’ is closed to new replies.