Permalink function not working?
-
Hi Friends…
This is my first post on the forum…so sorry if it’s a wrong category…
I have configured my blog smoothly so far…and trying to make some changes to the theme templates…
I want to display one category of posts (News) as a separate page, and also display separate links section for New and Non-News posts on left sidebar…
This is what I’ve written to display links to all but News items (category=7)…
<div class="box" id="featured"> <h3>Recent Posts</h3> <ul> <?php $myposts = get_posts('numberposts=5&category=-7'); //GET RECENT POSTS APART FROM NEWS CATEGORY foreach($myposts as $post) :?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <div class="cap"></div> </div>
Now, the_title() gives me correct titles for posts apart from News…but the_permalink() gives me blog home page… ??
I also tried with get_permalink($post->ID), but same result…
What is my mistake? ??
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Permalink function not working?’ is closed to new replies.