[Resolved] Recent Posts Exclude Category
I’m making own theme to my website. I’m in trouble with codes.
I want to recent 4 or 5 posts in all posts exclude one category.
My code is;
$id = get_cat_id(‘portfolyo’);
$q = “cat=-“.$id;
query_posts($query_string . $q); ?>
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<?php endwhile; ?>
I put some code below, above my code, nothing is happen;
$args = array( ‘numberposts’ => ‘2’ );
$recent_posts = wp_get_recent_posts( $args );
Thanks in advance.
- The topic ‘[Resolved] Recent Posts Exclude Category’ is closed to new replies.