Modify Output for Related Events

Home Forums Calendar Products Events Calendar PRO Modify Output for Related Events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #89425
    inhouse
    Participant

    Hi, I’m trying to modify the output of the related events function. Mainly I need to change the thumbnail size used instead of bringing in the “large” size I have a custom image size to use. I tried following the instructions I found Here but it wasn’t detailed enough for me to understand.

    Where do I add the code to remove the existing output? I tried both my theme functions file and wp-config file but both attempts are bringing in blank pages.

    Does the copy of the original tribe_single_related_events function in events-calendar-pro\public\template-tags\general.php go in my theme functions file? Do I need to rename the function? With other plugins I didn’t have to remove the original function as long as I renamed the copied function I placed in my theme functions file. Also, do I need the entire content under found under tribe_single_related_events?

    Thanks in advance for any help!

    #90428
    Brook
    Participant

    Howdy inhouse,

    These are some good questions.

    First of all, Barry’s advice would allow you to make modifications to without learning our themers guide. Here is a more complete example of what he is talking about: http://pastebin.com/zTfw5MRz

    You could paste that code in your theme’s function.php. Basically what this does is remove any calls to the default tribe_single_related_events(), and replace them with the newly created custom_tribe_single_related_events() which you can customize freely. For instance, you will notice right in line 12 the following get_the_post_thumbnail( $post->ID, 'large' ). That is the code you should modify if you wish to change the thumbnail size.

    Does that help get you rolling on the right track? Does it all make sense?

    – Brook

    #91325
    inhouse
    Participant

    Thanks Brook, that was helpful. I ended up removing the tribe_single_related_events() function from my template override and called the data I needed directly.
    Ex.

    
    $start_date = tribe_get_start_date();
            $end_date = tribe_get_end_date();
             if(!empty($start_date)) {
             echo '<div class="single-event-start-date">' . $start_date . '</div>';
             }
    

    I’m trying to change the date format to use “to” instead of “@”. Do I do this with tribe_events_event_schedule_details? I tried placing this function in my theme functions file but it breaks everything and displays a blank screen. Is this because I need to remove_action/add_action? I tried to figure it out on my own but I’m not sure if this is even the issue. It was a ton of code to just edit the ampersand. After that I should be done with related events! Thanks for all your help.

    #92318
    Brook
    Participant

    Howdy inhouse,

    I am really glad the last post was helpful.

    The blank screen is usually an indication that you are generating a fatal PHP error and that your sever is set to not display it. You would have to consult your server logs for details on errors in circumstances like that.

    When diving into template overrides there is an unfortunate but necessary expectation that the developer (in this case you) is versed in PHP, comfortable with debugging, and knows the WordPress API. Because of that expectation, when it comes to things like fatal errors it is up to the developer’s knowhow to resolve it.

    I hope you understand. I would be glad to assist with our API though if you do have more questions. Does that get you pointed in the right direction? Thanks!

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Modify Output for Related Events’ is closed to new replies.