• Sorry, I’m sure this is real WordPress 101 stuff, but I can’t figure it.

    At the bottom of my post, of a particular category, I would really love to have a link list of the other posts of the same category. Is that something I can make happen automatically?

    Many thanks!

    Bill

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter billdawes

    (@billdawes)

    OK, I figured it out, but I have possibly used a sledgehammer to crack a nut here, so if I have missed some simple one-click setting on the admin panel somewhere, please tell me!

    What I did was edit single.php, with the following code inside the loop, in a set of divs labelled postLinkPages which I haven’t actually seen doing anything else of use yet?? [Can someone tell me what they’re for?]

    <?php if ( in_category('4') ) {
    	$category_link = get_category_link('4');
     	$my_query = new WP_Query('category_name=boards&posts_per_page=10');
    		while ($my_query->have_posts()) : $my_query->the_post();
    	?>
         	 <span><a href="<?php the_permalink() ?>" title="<?php _e('Permalink to', 'Arjuna'); ?>
    	 <?php the_title(); ?>"><?php the_title(); ?></a></span><br />
    	<? endwhile; ?>
    <p><a href="<?php echo $category_link; ?>" title="Read more board reviews">Read all board reviews...</a><p>
    <?php } ?>

    (I’ve gone one step further than my original request, and it now just gives the first 10 listings for the boards category (id=4), if the post is of that category)

    U can use relateed post plugin and change the settings to get the posts of that category only

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to list other posts of the same category on a post’ is closed to new replies.