I've been trying to work out the code for a link to display in the footer of my site such that it brings the user to the login page only if the user is not logged in. Once he/she is logged in, that same link will logout the user instead. I have Q2A linked to my WP install, so I was thinking along the lines of the wp_loginout function, but my PHP-fu isn't quite good, so any help you guys might be able to offer me would be much appreciated.