Current post template tags
-
I am looking for making my single post template.
Inside the loop, I want to have:
1. The title
2. The current post’s slug
3. The previous link in the same category, but I want the title and link separately
4. The next post in the same category, with title and link separateThe code for 1 works, it’s
get_the_title()
.The code for 2 – there seems to be no tag, so I myself try to do
strtolower
andstr_replace
of the title. Is there an easier way? Why can’t I access the current post’s slug?The code for 3 and 4 – “previous_post_link” only seems to want to give the entire link with A HREF and all. How can I make it give me only the link and title of the previous and next posts separately to use in my own code (because I need to put a <A CLASS=””) in there.
Thanks!
- The topic ‘Current post template tags’ is closed to new replies.