Thread Starter
fkaf
(@fkaf)
Could anyone post a screen image so that I can see what the widget is supposed to look like? my have changed look.
All I need is a set of links for posts of a certain categori in the sidebar
Consider downloading and installing Otto’s PHP Code Widget, then something like this code in one of those widgets:
<?php
$cat_id = get_cat_ID('yourcategory');
$args=array(
'cat' => $cat_id,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 5,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
Thread Starter
fkaf
(@fkaf)
Yes, but there was a widget which did this without any code.
And listed the posts in the sidebar. What was that widget? I thought it was query posts but if I use that more than just a link appears
how many times do you plan on posting this?
dupes deleted and 1 had a good answer for you
Thread Starter
fkaf
(@fkaf)
Sorry
Category posts plugin did it! Thanks