[Plugin: Events Category] Works but inteferes with other dates in loop
-
Hi,
I am using this widget on a page that prints out (in list form) the most recent items for a few categories (there is a news list and an events list)
When I added the event category code to my loop, it made the date for my news links dissapear.
The code is below:
<?php global $post; $the_newest = get_posts('cat=4&showposts=2'); $the_newer = get_posts('cat=3&showposts=2'); ?> <ul id="events"> <?php foreach($the_newest as $post) : setup_postdata($post); ?> <li class="news_post_1" id="post-<?php the_ID(); ?>"> <h2><a href="<?php echo get_permalink(); ?>"><?php if (strlen($post->post_title) > 25) { echo substr(the_title($before = '', $after = '', FALSE), 0, 25) . '...';} else {the_title();} ?></a></h2> <p><?php eventscategory_get_the_time('l j F, Y') ?> | <a href="<?php echo get_permalink(); ?>">More...</a></p> </li> <?php endforeach; ?> </ul> <ul id="news"> <?php foreach($the_newer as $post) : setup_postdata($post); ?> <li class="news_post_1" id="post-<?php the_ID(); ?>"> <h2><a href="<?php echo get_permalink(); ?>"><?php if (strlen($post->post_title) > 25) { echo substr(the_title($before = '', $after = '', FALSE), 0, 25) . '...';} else {the_title();} ?></a></h2> <p><?php the_date('l j F, Y') ?> | <a href="<?php echo get_permalink(); ?>">More...</a></p> </li> <?php endforeach; ?> </ul>
Any help would be great as the plugin is perfect for my needs,
Thanks,Michael
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Plugin: Events Category] Works but inteferes with other dates in loop’ is closed to new replies.