WordPress.org

Ready to get started?Download WordPress

Forums

Multiple category posts (1 post)

  1. shobhit_web
    Member
    Posted 1 year ago #

    In my site i have created a page template to show only a specific category post, but this post is also attached with multiple category.. Now when we add a code to show related category post it shows those category posts which are top in alphabetic order.

    Like my category is 'Poster' and related post is also attached with 'Art' so it's shows Art category name and post on that post along with it's category name.

    How could i fix it..
    I have tried:
    ----- ------------- ---------
    <?php
    uery_posts('cat=4&showposts=27'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php endwhile; ?>
    <?php endif; ?>
    --------- ------------ -------
    and

    <?php

    $category_query=new WP_Query(array('category_name'=> 'Poster','showposts'=>'47','order'=>'desc'));?>
    <?php while($category_query->have_posts()):
    $category_query->the_post();
    ?>
    <?php endwhile; ?> code but result are same.
    Please suggest me..

Topic Closed

This topic has been closed to new replies.

About this Topic