how do I format shortcodes in Events+

I'm trying to format the shortcode into a page ( as a list - not calendar), I want a list of the upcoming events for the next 4 weeks I have tried [eab_archive weeks="4"] and only 1 event shows, verified events are entered correctly.

  • Vinod Dalvi
    • WP Unicorn

    Hi @Terry,

    I hope you are well today and thank you for your question.

    I'm trying to format the shortcode into a page ( as a list - not calendar)

    The eab_archive shortcode by default displays events as list.

    Please advise.

    I want a list of the upcoming events for the next 4 weeks I have tried [eab_archive weeks="4"] and only 1 event shows, verified events are entered correctly.

    Could you please try using the following shortcode?

    [eab_archive lookahead="true" weeks="4"]

    If it doesn't work then would you mind if I logged in to your site and did some testing? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings from the following path and reply on this thread after granting it?

    Admin -> WPMU DEV -> Support -> Support Access Tab

    Kind Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi @Terry,

    Thank you for your reply.

    You can display featured image for each event in the events list page created using eab_archive shortcode.

    To achieve this set the featured image for the events from the edit event page then use the following shortcode in the events list page.

    [eab_archive template="events-shortcode-archive.php"]

    Create a file events-shortcode-archive.php containing following code in the root directory of your child theme.

    <section class="eab-events-archive <?php esc_attr_e($args['class']); ?>">
    <?php foreach ($events as $event) { ?>
    	<?php $event = $event instanceof Eab_EventModel ? $event : new Eab_EventModel($event); ?>
    	<article class="eab-event <?php echo eab_call_template('get_status_class', $event); ?>" id="eab-event-<?php echo $event->get_id(); ?>">
    		<h4><?php echo $event->get_title(); ?></h4>
    		<?php $rawthumbsrc = wp_get_attachment_image_src(get_post_thumbnail_id($event->get_id()), array(50,50));
    			$eventthumb = $rawthumbsrc ? @$rawthumbsrc[0] : false;
    			$content = '';
    			if($eventthumb){
    				$content .= '<img style="max-width: 50px;" class="alignleft img-thumbnail" src="'.$eventthumb.'">';
    			 }?>
    		<div class="eab-event-body">
    			<?php echo $content; ?>
    			<?php echo eab_call_template('get_archive_content', $event); ?>
    		</div>
    	</article>
    <?php } ?>
    </section>

    I have tested it on my test site and it's working fine for me.

    Please let me know how it works for you.

    Best Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Terry,

    I have changed my previous code to resolve the duplicate image issue and change the thumbnail size so please try using it.

    To display the line between events try adding the following CSS code in the style.css file of your child theme or add it in your site using the following plugin.

    http://wordpress.org/plugins/simple-custom-css

    .eab-events-archive .eab-event {
    border-bottom: 2px dotted;
    }

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.