function based on role
-
Hi, i’m a novice to php and am trying to figure a function out.. please help me! before i go nuts ??
I have on different pages different dynamic sidebars.. now I want to add above the regular sidebar a sidebar based on user role..
I have added following lines to my themes sidebar.php:
<?php if ( current_user_can('partner') { ?> <?php dynamic_sidebar( 'partner' ); ?> <?php endif; } ?>
but though calling the sidebar itself works, all sidebars go blank with the if and endif lines..
do I first need to add the ability in functions.php? I hadn’t because I thought i was calling a regular wp function..
btw, i′m aware of the plugin “sidebar per user role” but this replaces the sidebar on all pages whcih is not what i’m looking for..
appreciate any pointers.. thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘function based on role’ is closed to new replies.