Can someone help me hide the sidebar based on login status?
-
Someone else in the forums here said:
<? get_currentuserinfo() ; global $user_level; if ($user_level > 0) { echo "yes"; } else { no } ?>
Well, everything you want people to NOT be able to see will go in where yes is. Just remember that whatever code you put in there, you replace all the ” with ‘
I have tried placing that code in my theme’s index.php file in between
<?php get_sidebar(); ?>
and
<?php get_footer(); ?>
but it doesn’t work. I get an error message regarding the line below the “no”, with the lone “}” on it.
Can someone please help me? Bear in mind you’re talking to someone who knows .html but not a dang thing about coding .php
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Can someone help me hide the sidebar based on login status?’ is closed to new replies.