ulises2010 Posted November 15, 2013 Share Posted November 15, 2013 (edited) Hi, I need to show a diferent sidebar for logued an unlogued visitors. I try this: I create a new sidebar in functions.php whit this code: register_sidebar(array( 'name' => 'Sidebar para logueados', 'id' => 'sidebar-logueados', 'before_widget' => '', 'after_widget' => '</div> <!-- end .widget -->', 'before_title' => '<h4 class="main-title widget-title">', 'after_title' => '</h4><div class="widget">', )); Whit this, I have a new sidebar under aparence-->widgets where I can put difernts widgets After, I go to the page template (page.php) and change this code <?php get_sidebar(); ?> whit this one <?php get_currentuserinfo() ; global $user_level; if ($user_level > 0) { echo get_sidebar('sidebar-logueados');; } else { echo get_sidebar();; } ?> I think all is ok, but don't works.... can anybody help me? Thanks Edited November 15, 2013 by ulises2010 Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 15, 2013 Share Posted November 15, 2013 If you follow this tutorial it should work. http://ablereach.com/wordpress/wordpress-add-a-second-widget-ready-sidebar/ Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 15, 2013 Share Posted November 15, 2013 Does it work using is_user_logged_in() function? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.