<?php if ($user_level > X { ?>
blah-blah-blah
<?php } ?>
I finally got around to trying this and I get errors.
Parse error: parse error, unexpected ‘{‘ in
any suggestions on this error?
has anyone else gotten this to work?
<?php global $userdata;
get_currentuserinfo();
if ($user_level > 0) {
?>
**enter html here or put PHP within the php breackets**
<?php }
?>
Please, can you tell me what is my mistake. I want to hide sidebar “Links” from unregistered users… And it doesn’t work – links dissapear.
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
<?php global $userdata;
get_currentuserinfo();
if ($user_level > 0) {
?>
<?php get_links_list(); ?>
<?php }
?>
Thanks!
concerning Whitepimp’s suggestion,
What worked for me was this:
<?php global $userdata;
get_currentuserinfo();
if ($userdata->user_level > 0) {
?>
….
<?php }
?>
If you noticed the if clause is different here. More on this issue here:
http://codex.wordpress.org/get_currentuserinfo
Caner
Papercuts3, thanks a lot!!! Now it works. 🙂