I’m a noob at this so please bear with me.
I have the following code to return post title as links within categoryID 6, which is working fine:
<?php global $post; $cat_posts = get_posts('numberposts=10&category=6');
foreach($cat_posts as $post) : ?>
<?php $postTitle = get_the_title(); if($title != $postTitle) :?>
<li><a href="<?php the_permalink(); ?>">›› <?php the_title(); ?></a></li>
<?php endif ;?>
<?php endforeach; ?>
However, the category ID is a variable, e.g. $catID, can I use this in the above code?
Thanks in advance!
Have you tried the following code?