Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134402

umdechai on "Display post title from page slug"

$
0
0

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 all articles
Browse latest Browse all 134402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>