Thanks for this! I’m running into a problem though. I’m using Otto’s PHP code widget and pasted what you posted. It’s pulling the link for the page that I’m on…not my posts?
If I have both “Recent posts” and the PHP code widget added, then the PHP code pulls from my recent posts correctly. But I don’t need/want both of these widgets.
Any clue why it’s behaving like this?