Support » Fixing WordPress » Custom sidebar conditionals

  • Resolved stuboo


    I’ve read through the conditionals to try to figure out a way to make this happen but so far have had no luck. Here’s what I’d like to do.

    if (is_page('12') || is_category('3')){?>
    <h2>Recent Posts</h2>
    $posts = get_posts('numberposts=4&category=3');
    foreach($posts as $post) :
    <p class="title">"><?php the_title(); ?><?php the_excerpt(); ?>
    <?php endforeach; } ?>

    As it is written, the is_category() tag won’t work because this conditional only works “When the archive page for Category 3 is being displayed.”

    How can I do this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom sidebar conditionals’ is closed to new replies.