Hello. I'm changing a wordpress theme and I'm almost all done but I have a small problem I can't figure out. I'm going to post the code below; <div id="rec" class="hiddencontent"> <?php $my_query = "showposts=10"; $my_query = new WP_Query($my_query); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <h5>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h5> <p><?php the_time('F j, Y') ?> <?php the_category(', ') ?></p> <?php endwhile; ?> </div> Code (markup): The code above is for a small tabber I have on the right side and at the moment it showes the 10 recent posts put on the blog from all categories but I would like it to only show the 10 recent posts from a certain/indvidual category. I named the category "A lausu" and the url name is "alausu" Is there any chance someone could help me out with my small problem Thanks in advance, best regards
This may not work because of a bug in WP2.7 <?php $my_query = "showposts=10&category_name=A lausu"; $my_query = new WP_Query($my_query); ?> Better to use the category ID number if you can. <?php $my_query = "showposts=10&cat=ID"; $my_query = new WP_Query($my_query); ?>