Hi,
I’ve been working on a solutions for a few days now and I know what I want, but I can’t figure out how to get it.
I am trying to write a query that will grab the previous post entry_date and url_title_path or similar link to next/previous entry. However, when I try to write my query I get an error.
Here is the code I’m using:
{exp:query sql="SELECT entry_date, url_title_path FROM exp_weblog_titles ORDER BY entry_date ASC LIMIT 2"}
<a href="http://{url_title_path}">{entry_date format="%Y %m %d"}</a>
{/exp:query}What I’m trying to do is pull the last post and display the date of that post, then I’ll need to be able to use that code again but in reverse in case there in a “Next” post so reversing the ASC order should make it work.
How would I get the second count rather than the first, going both ways, and what do I need to use to get the {url_title_path} for that post?