[EventCalendar] Re: Upcoming events in a page.

Samuel Clemance s_clemance at hotmail.com
Mon Dec 1 07:34:35 UTC 2008


Sorry for my ignorance.  If anyone has the time to tell me how to do this 
correctly let me know.  Here's what I have so far:

<?php
/** Usage: [EC3UpcomingEvents mycat="options" numposts="options"]
 *  Gets replaced by an upcoming event list. */
function ec3_upcomingevents_func($atts, $content = null)
{
  extract(shortcode_atts(array(
    'mycat' => null,
    'numposts' => 5,
  ), $atts));
  query_posts("ec3_after=today&cat=$mycat&posts_per_page=$numposts");
  if ( have_posts() ) : while(have_posts())
    {
      the_post();
    }
?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br>

<?php
  endwhile; else:
?>

<p>There are currently no upcoming events</p>

<?php
  endif;
  }
}
add_shortcode('EC3UpcomingEvents', 'ec3_upcomingevents_func');
?>

If I scratch the query_posts all the way down to the endif and just return 
the variables it works so I am obviously not returning the query etc. 
correctly.  What is the best way of doing this?

--------------------------------------------------
From: "Alex Tingle" <alex at firetree.net>
Sent: Friday, November 28, 2008 5:55 PM
To: "Support for EventCalendar plugin" <eventcalendar at firetree.net>
Subject: Re: [EventCalendar] Re: Upcoming events in a page.

> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
> 



More information about the EventCalendar mailing list