WordPress.org

Ready to get started?Download WordPress

Forums

Display specific category form post type in Loop (1 post)

  1. TataVostru
    Member
    Posted 2 years ago #

    For example if i have Mondene(category) in Post_Type : stiri
    How can i display only the category news...

    <?php
    $recentPosts = new WP_Query();
    $recentPosts->query(array('showposts' => 1, 'post_type' =>array('stiri')));
    ?>
    <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic