displaying multiple organizers on list & Single view

Home Forums Calendar Products Events Calendar PRO displaying multiple organizers on list & Single view

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1066749
    divcom_uk
    Participant

    Hi There. I’m using the Event Calendar Pro, and i’ve been doing some custom templating for events as the organizer (in this use case this is being used to show ‘speaker’ information) is quite important so i’ve opted to show it at the top of the event listing rather than in the smaller meta panel.

    I’m calling the info in using this tag: <?php echo( tribe_get_organizer_link() ); ?> which works perfectly and returns the speaker link as expected
    The issue is that some events have multiple speakers, ie when it’s a panel debate or being co-presented. Is there a way to display multiple organizers in this way? and will this work for the /list/single-event as well as the main single-event template?

    Second question on the same topic- how hard would it be to pull in the event organizer’s featured image and ideally their content (in this case it’s a speaker bio ) into the main single event template? is there a function for this built in?

    Many Thanks,
    Pete

    • This topic was modified 10 years, 2 months ago by divcom_uk.
    #1067340
    Cliff
    Member

    Hi Pete. Thanks for your questions.

    These are definitely advanced customization questions, for which we offer our Themer’s Guide resource but not support.

    However, we can offer a bit of assistance to hopefully get you on your way.

    I think you’d do well to reference and read through the comments of this file: /wp-content/plugins/the-events-calendar/src/views/modules/meta/organizer.php

    As for featured image, once you have the Organizer Post ID, you can use WordPress’ get_the_post_thumbnail()

    I hope this helps. Please let me know how you get on!

    #1067675
    divcom_uk
    Participant

    Thanks Cliff! it definitely started me in the right direction. i’ll admit i am a php novice, so excuse the terminology if it’s a little off- but here’s my solution, at least for the multiple links:

    1: in the ‘single-event.php’ templates in the corresponding folders :/tribe-events, tribe-events/list, tribe-events/day, i ensured i was getting the correct information by adding the following snippet to the initial template query (the bit at the top for other noobs) like so:

    $organizer_ids = tribe_get_organizer_ids();
    $multiple = count( $organizer_ids ) > 1;

    then instead of <?php echo( tribe_get_organizer_link() ); ?>
    i used a modified version of the code from the organizer.php template with the additional markup and details stripped out :

    <?php
            $organizer_ids = tribe_get_organizer_ids();
    $multiple = count( $organizer_ids ) > 1;
    
    		do_action( 'tribe_events_single_meta_organizer_section_start' );
    
    		foreach ( $organizer_ids as $organizer ) {
    			if ( ! $organizer ) {
    				continue;
    			}
    
    			?>
    			
    				<?php echo tribe_get_organizer_link( $organizer ) ?>
                    
    			
    			<?php
    		}
    
    		if ( ! $multiple ) { 
    		}//end if
    
    		do_action( 'tribe_events_single_meta_organizer_section_end' );
    		?>

    This just returns a series of links, i added in commas using the a:after pseudo element, and removed it from the final item by using the a:last-of-type:after selector.
    I’m looking into the featured images now, will post updates as i make progress!
    thanks again.
    Pete

    • This reply was modified 10 years, 2 months ago by divcom_uk.
    #1067770
    Cliff
    Member

    Thanks for the update.

    Instead of adding commas via CSS, you might try changing

    echo tribe_get_organizer_link( $organizer )

    to

    echo tribe_get_organizer_link( $organizer ) . ', '

    Keep up the good work.

    #1079909
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘displaying multiple organizers on list & Single view’ is closed to new replies.