• Resolved ksaffy

    (@ksaffy)


    Hi,

    I’m using Events Manager with your plugin (great work btw) and I’ve got the related events pulling fine and the layout I want using a variation on your thumbnail template file. So far so good. The only issue I’m having is trying to work out how to exclude ‘past’ events from the results. If I set the ‘Show only Clubs from the past’ x d/w/m, it’s not really helping with my issue as this uses the input or published date of the event rather than the event date. An event can be input months before the date of the event.

    Can you suggest some way for me to exclude all events when the event becomes a past event? Any help is very much appreciated.

    Thanks!

    https://www.ads-software.com/extend/plugins/yet-another-related-posts-plugin/

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter ksaffy

    (@ksaffy)

    The file you’ve pasted the function in, is it for events only? Have you tried using the code above in your template but making sure NO Automatically display options for posts/pages/events are checked in the display option settings?

    the code i just showed you is in the single-event.php
    There is no automatic output of related posts set at all, not even for blog posts.
    blog posts have a different template than the events.
    the events template is modelled on what is in this thread.

    you can check out what i mean here
    https://montreal.wherearetheshows.com/shows/horrible-things-3/

    it shows a blog post, and not any related event

    Thread Starter ksaffy

    (@ksaffy)

    OK, here’s my full code for what I have in single-event.php (I’ve taken out the unnecessary code for other things I have). I’m using events manager, I’m assuming you’re using the same.

    https://pastebin.com/JHR54Amb

    When <?php related_posts(); ?> is called, it should call the yarpp-template-thumbnail.php, if <?php custom and the Thumbnail template is selected in display options. So you shouldn’t really need to define a related posts array in the function.

    Sorry but I can’t think of anything else to help you to get it to work for your theme.

    ok, seems like i managed to get somewhere, instead of related_posts(), i used related_entries() which seems to bring all post types with related info, e.g: shows posts, events and locations.

    now i’m filtering them out by finding if a result has an event id or not, and just display ones that do.

    not sure why i’m having different results and experience than you. i’m not doing anything to far off from what your doing.

    Thread Starter ksaffy

    (@ksaffy)

    Yeah! Well I’m glad you’ve got it sorted. I think the answer lies in the great mystery that is WordPress and themes.

    fyi, this is what finally worked for me

    <?php if(function_exists('related_posts')){
    		related_entries(array(
    	  'post_type' => 'events',
    	  'show_pass_post' => false,
    	  'past_only' => false,
    		'weight' => array(
          'tax' => array(
            'event-tags' => 5,
    /* 					        'event-categories' => 5, */
        )),
        'require_tax' => array(
            'event-tags' => 2,
            'event-categories' => 1,
        ),
    	  'threshold' => 1,
    	  'template' => 'yarpp-template-events.php',
    	  'limit' => 5,
    	  'order' => 'date DESC'
    	), $post->ID , true);
    } ?>
Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Events Manager & YARPP’ is closed to new replies.