Support » Fixing WordPress » query posts to static front want to add category parameter

  • I am using

    <div id="frontpagepostpull">
    <?php $temp_query = $wp_query; ?>
    <?php query_posts('showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    	<div class="post" id="post-<?php the_ID(); ?>">
    	<h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h4>
    <?php the_post_thumbnail('front-page-post-thumbnail'); ?>  <?php the_excerpt(); ?>
    	</div>

    To pull the first post to the static front page.
    What I really need for this is the first post in any of 3 different categories.
    How would I write that in?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'staff, news, other',
    	'posts_per_page' => 1,
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    Thanks Esmi,
    But that (with the proper category names) did not pull anything to the static front page.
    What am I missing?

    esmi

    (@esmi)

    Forum Moderator

    Remember to use the category slugs – not the displayed names.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘query posts to static front want to add category parameter’ is closed to new replies.