Support » Fixing WordPress » Post from a different catagory at the top of the catagory page

  • j0d


    as an example( the top post is in the catagory headline,

    What i wanted to know if there is a way of ,on the catagories page, put the post that is in both under the catagory page it is on and that it is either a headline or subheadline at the top?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Kafkaesqui


    Um, what? You want the “top post” to appear at the top of every category page? Or are you asking to take the posts appearing on the main page under their respective “headlines” to *stick* at the top of each category page?

    I’m not quite understanding your request, so provide some more detail.



    sorry i apologise for not being clear,

    I would like, the first post on each catagory page, to be the post that is both from under that catagory AND under the headline or subheadline catagory, As an example

    On the “entertainment” catagory page the article placed at the top, will be under the catagory “entertainment” and “subheadline”or “headline.

    Hopefully that explains it better, Any help would be appreciated thanks.

    I know what you mean! cos I want to do that too. Did you find a way?

    judicious use of a category templates and the query_posts() will help you reach your goal. ah… but you also need to use multiple loops so you can continue to display the normal category:

    create a category.php template, which will be used to display each of your categories. whereever you want to display your headline post place this:

    <?php $temp_query = $wp_query; ?>
    <?php query_posts('category_name=headline&showposts=1'); ?>

    <!-- insert your loop here to display the entry like this simple one below: -->

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> </h2>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <?php endwhile; else : endif; ?>

    // now back to our regularly scheduled programming
    <?php $wp_query = $temp_query; ?>

    and you can have the rest be the normal loop you were going to use anyway, and it should all display nicely.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post from a different catagory at the top of the catagory page’ is closed to new replies.