Maximilian

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Use calendar list view for custom event categories #1214913
    Maximilian
    Participant

    I now got the sorting to work by modifying the query meta_key and orderby like this:

    
    function customize_customtaxonomy_archive_display ( $query ) {
    	if (($query->is_main_query()) && (is_tax( array('zielgruppe', 'autor') ))) {
    		$query->set( 'meta_key', '_EventStartDate' );
    		$query->set( 'orderby', '_EventStartDate' );
    		$query->set( 'order', 'ASC' );
    		$query->set( 'posts_per_page', -1 );
    	}
    }
    

    This wouldn’t work on the normal posts that get mixed in between because they don’t have any _EventStartDate. So I added it on save_post for non-events. It uses the post creation date.

    So far so good. I can correctly query the events and posts I want and even sort them. Even if the _EventStartDate field for normal posts is kinda hacked I guess.

    Now there are two problems left:
    1. There are some the event calendar wrappers and scripts etc missing because I’m just pulling the list template in. Is there a more proper way to do this? Is there a way to fix pagination or should I leave it out?
    2. Is this future proof or hacked in a way that it might break with the next bigger update?

    Sorry again for posting so much, thanks for reading!

    in reply to: Use calendar list view for custom event categories #1214888
    Maximilian
    Participant

    Sorry for the triple post but I noticed one more obvious thing.
    Forcing the template in like I posted before works partially but of course apart from the pagination breaking the event order isn’t working either. It shows the event not in chronological event order but in the order they got posted via WP.

    The ideal solution would make it possible to use the event list view for my taxonomy template and also show normal posts that share the taxonomy.
    If its just about the events I guess you could modify taxonomy templates to use the tribe_get_events() function? Don’t know exactly how that would work though or how I could insert other post types on top of that.

    Maximilian
    Participant

    I’m not support here but was similarly confused at first.

    On the settings page where you enter your license key you can enter two keys. One for Event Aggregator and one for The Events Calendar PRO.
    Did you maybe use the wrong field to enter your key? You said you bought the PRO version, not the Aggregator. If so you have to enter it in the bottom The Events Calendar PRO field.

    in reply to: Use calendar list view for custom event categories #1214832
    Maximilian
    Participant

    I managed a way to somehow force the list view into a taxonomy template with this:

    
    <?php get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    		<?php get_template_part( 'tribe-events/list' ); ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php
    get_sidebar();
    get_footer();
    ?>
    

    This kinda(?) works but pagination breaks. Is there a way to get this to work more nicely?

    edit: welp, no way to unmark this as correct answer I guess

Viewing 4 posts - 1 through 4 (of 4 total)