ulises2010 Posted November 15, 2013 Share Posted November 15, 2013 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 Link to comment https://forums.phpfreaks.com/topic/283926-new-sidebar-in-wordpress-site/ 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/ Link to comment https://forums.phpfreaks.com/topic/283926-new-sidebar-in-wordpress-site/#findComment-1458412 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? Link to comment https://forums.phpfreaks.com/topic/283926-new-sidebar-in-wordpress-site/#findComment-1458414 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.