WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Select a category to print (2 posts)

  1. Dezio
    Member
    Posted 1 year ago #

    I need to print post of cat=5 and I need to modify this part of code but Im not a programmer:

    <?php $wp_query = new WP_Query(array('cat'=>of_get_option('category_blog'),'showposts'=>of_get_option('postnumber_blog'),'paged'=>$paged)); ?>
    <?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <?php global $more; $more = 0; ?>

    I try to add this:
    <?php query_posts('cat=5'); ?>
    but it doesn't work.
    Anyone can help me?

    Regards

  2. Dezio
    Member
    Posted 1 year ago #

    Found :)
    Just modify this:

    'cat'=>of_get_option('category_blog'),

    to this:

    'cat'=>5,

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.