Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   [SOLVED] Very simple: Conditional "|" Separator (http://forum.bytesforall.com/showthread.php?t=6623)

scott.crooks Apr 6, 2010 12:17 PM

[SOLVED] Very simple: Conditional "|" Separator
 
I have a very simple question. In the footer of my page, I am using the %admin% variable to display the link to the WP admin dashboard. I have other links beside the Site Admin that are each separated by a " | ". However, when I'm not logged in, the Site Admin link disappears (as it should) but there still remains a " | " next to one of the links and it looks goofy.

I've attempted to solve this problem by using a super simple PHP script shown below.

PHP Code:

<?php if ($admin_link !== null) {echo " | ";} ?>

However, this does not work. I've attempted other tests like "!== 0" or "isset($admin_link)" but those do not work either. I am confused on the structure of this variable $admin_link it seems. What should I be using?

For the record, I am running WordPress 2.9.2 and Atahualpa theme 3.4.6.

juggledad Apr 6, 2010 01:23 PM

try using 'is_user_logged_in()' ie
HTML Code:

<?php if (is_user_logged_in()) {echo " | ";} ?>

scott.crooks Apr 6, 2010 01:55 PM

Worked like a charm. Thank you!


All times are GMT -6. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.