[EventCalendar] Re: removing calendar posts from sidepanel (was 'Customising EventCalendar')

ejm llizard_ejm at yahoo.com
Thu Jun 1 06:17:34 UTC 2006


On Mon May 29 07:26:26 2006, Theunis Groenewald Design Bureau wrote:
>
>The question now is: How do I remove the posts belonging
>to the calendar from the sidepanel? I want to remove the
>Calendar category, as well as the posts that are posted
>in the Calendar category.
>

For removing the post links belonging to the calendar from the
sidebar, you could try the method that I found in the wordpress codex
(at least I think that's where it was) This is what I have on my
sidebar to remove my calendar (category 4 on my wordpress) posts:

----------------------------------
<ul>
<?php $temp_query = $wp_query; query_posts('&cat=-4'); //exclude
category 4 ?>
<?php while (have_posts()) { the_post(); ?>
<li><a href="<?php the_permalink(); ?>" rel="bookmark"
title="Permanent Link to &ldquo;<?php the_title(); ?>&rdquo;"><?php
the_title(); ?></a></li>
<?php } $wp_query = $temp_query; ?>
</ul>
-------------------------------

By the way, you should only have one div with the id of sidenav.
Suggestion for your sidebar:

----------------------------------
<?php _/* If this is the frontpage */ if ( is_home() ) { ?>

<div id="sidenav">
<h2 class="sidebar">Nuus Argiewe</h2>
<ul id="sidenavlist1">
<?php wp_get_archives('type=monthly'); ?>
</ul>

<h2 class="sidebar">Nuus Kategorie&euml;</h2>
<ul id="sidenavlist2">
<?php wp_list_cats('sort_column=name&hierarchical=0'); ?>
</ul>

<?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM
$wpdb->posts WHERE post_status = 'publish' AND post_date_gmt <
'$today' ORDER BY post_date DESC LIMIT 10")):
?>

<h2 class="sidebar">Onlangse Nuus</h2>
<ul id="sidenavlist3">

<?php 
//(CHANGE THE NUMBER AFTER &cat= TO WHICHEVER NUMBER YOUR CALENDAR
CATEGORY IS 
$temp_query = $wp_query; query_posts('&cat=-4'); //exclude calendar
category
?>
<?php while (have_posts()) { the_post(); ?>
<?php
 foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "<li><a
href='http://mail.yahoo.com/config/login?/".get_permalink($post->ID)."'>";
the_title();
echo '</a></li>';
}
?>
</ul>
</div>
<?php endif; ?>
-------------------------------
  
At least I think that will work!

-ejm

P.S. I'm glad that at least some of the skinning tips have worked for
you, Theunis.




More information about the EventCalendar mailing list