the_permalink() returns empty string inside the loop
-
I’m kinda at a loss on this one. None of my header link URLs are correct because my “the_permalink()” statement in the code below is returning an empty string (this is inside header.php)…
Any ideas what might be the cause?
<div class="myheader"><div class="myTitle"><a href="/"><?php bloginfo('name'); ?></a></div><div class="myTagline"><?php bloginfo('description'); ?></div><div class="myMenu top"><ul> <?php global $post; $cat=get_cat_ID('my-menu'); if($cat > 1) {$myposts = get_posts('numberposts=5&category='.$cat);} else {$myposts = get_posts('numberposts=10');} foreach($myposts as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><?php endforeach; ?></ul></div></div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘the_permalink() returns empty string inside the loop’ is closed to new replies.