Point entry to individual page

This topic contains 8 replies, has 2 voices, and was last updated by  Stephen Harris 3 months, 4 weeks ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42635

    Hello,

    I would be entirely grateful for help.
    I added an individual field to an event and filled it with the url I want this event to link to.
    “Kalendertag-link”

    Now I want to use this filter
    http://codex.wp-event-organiser.com/hook-eventorganiser_calendar_event_link.html

    To excute that the event links to each individual link

    Here is my code:

    //Replace link to eventpage with link from individual field
    add_filter('eventorganiser_calendar_event_link','myportfolio_link',10,3);
    function myportfolio_link( $link, $event_id, $occurrence_id ){
    $the_post = get_post($post_id);
    get_post_meta($postid, 'kalendertag-link', true);
    $link=kalendertag-link;
    }
    return $link;
    }

    I am not entirely sure how to save the new event-organiser-ajax.php in a way that it won’t effected by future updates. I do have a child theme.

    Apologies for the n00b questions – I just want to make sure I understand the process right. Thank you.

    Fabienne Freymadl
    #42636

    Ok and another question: where do I ad this filter?

    Fabienne Freymadl
    #42785

    Hi Fabienne,

    This article gives the details: https://wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/

    But in short, ideally in a custom plug-in but you can get away with putting it in your theme’s functions.php (or child theme) if you don’t mind maintaining it. If you put it in your child theme’s functions.php then that lets you update the theme without losing the code

    Stephen Harris
    #42786

    Hello

    thank you for your help.
    I figured out where to place it, but it wont work as desired.

    /

    /Replace link to eventpage with link from individual field
    add_filter('eventorganiser_calendar_event_link','myportfolio_link',10,3);
    
    function myportfolio_link( $link, $event_id, $occurrence_id ){
    $the_post = get_post($post_id);
    get_post_meta($postid, 'kalendertag-link', true);
    $link=kalendertag-link;
    
    return $link;
    }
    

    This leads to the dates disappearing from the calendar, it seems they wont load in.

    Fabienne Freymadl
    #42787

    f*** hell, I did it:

        //Replace link to eventpage with link from individual field
    add_filter('eventorganiser_calendar_event_link','myportfolio_link',10,3);
    
    function myportfolio_link( $link, $event_id, $occurrence_id ){
    
    $link=get_post_meta($event_id, 'kalendertag_link', true);
    
    return $link;
    };
    
    Fabienne Freymadl
    #42790

    Solved.

    I replaced line 49 of shortcode-event-list.php

    with

    “><?php the_post_thumbnail(‘medium’); // mittlere Größe ?> <?php the_title(); ?>

    ‘kalendertag_link’ is the custom url I gave the event.

    Fabienne Freymadl
    #42812

    The shortcode-event-list.php file is a “template” file – if you copy it to your theme, the plug-in will use that file instead of the one included in the plug-in (which means you can update the plug-in without losing your changes).

    However, I think this has been superseded by this question on how to replace event links everywhere: https://wp-event-organiser.com/forums/topic/individual-link-shortcode-entry/#post-42811

    Stephen Harris
    #43381

    Hello,

    everything works as desired, thank you for your previous help!

    Now I would like to have the link pop up in a new window. How do I manage that?
    It should be fairly simple I guess.

    Fabienne Freymadl
    #43445

    You’d need to edit the template to that (See this line https://github.com/stephenharris/Event-Organiser/blob/develop/templates/shortcode-event-list.php#L48) – adding target="_blank" inside the <a ...> tag should do it.

    Stephen Harris
Viewing 9 posts - 1 through 9 (of 9 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.