Display post title from page slug
-
I want to display links to each post outside of the Loop.
This code works:
<ul class="nav"> <li><a href="#how"> <?php echo get_the_title(6); ?> </a></li> <li><a href="#logistics"> <?php echo get_the_title(9); ?> </a></li> <li><a href="#who"> <?php echo get_the_title(11); ?> </a></li> <li><a href="#tips"> <?php echo get_the_title(13); ?> </a></li> </ul>
But, it’s calling the title based on the post ID. I want to call the title based on the slug. Any way to do that?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Display post title from page slug’ is closed to new replies.