I noticed <?php the_title(); ?> doesn't work outside the loop. What would be a good way of calling the post title outside the loop.
Thanks.
I noticed <?php the_title(); ?> doesn't work outside the loop. What would be a good way of calling the post title outside the loop.
Thanks.
dint get u exactly ...
but try this
<ul>
<?php
$catposts = get_posts('numberposts=10&category=17');
foreach($catposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
you can use this for showing only titles of post from a partioular category...here 10 is the number of posts and 17 is the category id
How about using wp_title() or single_post_title()?
Thanks guys, esmi: <?php single_post_title(); ?> did the trick. Thanks.
On the same subject, I have a bit of code that outputs a 'you are here' kind of thing, but it gets displayed before the loop.
How do I get the single_post_title() for that post when the code generating it is before the loop?
You must log in to post.