you warped your code inside
if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
// code here
?php endif;
witch means that if you have any widgets on that sidebar the the code within the IF will not work. its basically using the code inside the if to use as default widgets and once you have a widget on the sidebar it ignores it.
so if your sidebar does have any widgets you need to run your is_user_logged_in function
inside a PHP capable widget.
hope this helps
Related Posts:
- Get list of all registered sidebars
- What is the difference with get_sidebar and dynamic_sidebar?
- Is there a is_user_logged_in() for multisite?
- Replacing the WordPress password validation
- WordPress auto login after registration not working
- how do I get_sidebar into a varaible?
- Best way of making multiple sidebars
- Hooking a function onto the sidebar?
- Allow up to 5 Concurrent Login Sessions
- Is it possible to sign in with user_email in WordPress?
- Changing name of sidebar widget
- Getting post-thumbnails from another WP site
- dynamic_sidebar not rendering sidebar
- Get custom side bar on custom post archive page
- Why does is_user_logged_in() return false after redirect from another site?
- bloginfo(‘stylesheet_directory’) vs. get_stylesheet_directory_uri() and include(‘file.php’) vs. get_template_part()
- How do I hook a sidebar via add_action?
- Changing user_nicename
- Display comment form of specific page in sidebar
- Pre-populate Username Field
- Category specific months list in sidebar.php
- Display sortable User meta column in admin panel user’s page
- Add featured image to sidebar [closed]
- Show newly added posts since last user login time /date
- How to create custom LOGIN and REGISTRATION forms?
- How to keep track of user logins?
- Get user info outside WordPress
- Is there possibility to Customize the present theme adding sidebars
- Get a sidebar at the top of the page
- Custom sidebar not showing in the dashboard
- Associate Page with User
- Sidebar random author spotlight
- How can I secure a WordPress blog using OpenID from a single provider?
- Sidebar Generator? :)
- Main Sidebar Dispappeared – What could possibly cause this?
- How do I create a specific login page for a specific user?
- Is it possible to get a user with just the password field?
- Change which sidebar get_sidebar() gets from functions.php
- How to exclude parent category but show child categories?
- Specific and Different Ads for each Post?
- Redirect after login based on user role (custom login page)
- Why and how is twentythirteen adding a margin-top to my footer?
- Adding content to sidebars
- Twenty Ten child theme has post on an inner page. Cant get that page to use my desired template
- Check for user meta data at Login
- Template part vs Sidebar (differences)
- automated tests as a user?
- Redirect User to Homepage if no other redirect is specified
- Change sidebar headers from H1?
- My custom page template with is_user_logged_in() does not detect that I’m logged in
- Load same sidebar multiple times
- Backend menu sidebar collapsed by default every time? [duplicate]
- Use phpbb user database for WordPress
- WordPress to use Drupal users’ credentials
- Share user table from WP with Drupal
- Get sidebars depending on page
- Specific theme for non logged in users
- change sidebar or just widgets for 2 specific post type single posts
- Unregister sidebar from Child-Theme
- Last time a user logged in
- How can I hide the sidebar on specific pages?
- How can I allow password reset based on logins containing the @ character?
- How to delete wordpress menu
- A way to count logged in users and display count?
- stop login if user_status equal zero
- Display sidebar if blog
- How can you add a link to a sidebar description?
- unregister_sidebar() in stand-alone theme not working
- CSS Twentyeleven / Sidebar has to be changed IN the CSS Stylesheet. Sidebar on the left side
- Redirecting or displaying a message on first login
- How can I allow access to multiple users, using the same login, at the same time?
- How do i make my wordpress website private?
- Detecting all admins that are logged in
- Why does the TwentyTen Theme sidebar have a class called ‘xoxo’?
- Dynamic Sidebar for subcategory of a category
- Why is it that not all users have a ‘session_tokens’ meta_key record in the usermeta table?
- Redirect user to login before viewing custom post
- Same date is repeating on my custom ‘Most Recent Posts’ on sidebar
- Change the user_login at registration
- Max no of simultaneous active sessions for a single user
- How to add Sidebar and Full width option in post editor
- Corrupt WordPress Design/Appearance [duplicate]
- How are Dynamic Sidebar Widgets rendered
- how to exclude posts on current page from recent posts sidebar widget
- How to add a class when there’s no sidebar?
- Users disappeared from wp-admin
- Output dynamic_sidebar into PHP
- Creating a different side bar for single posts than for main page.
- Sidebar loop – Thematic Framework
- User management system similar to wordpress one?
- WP for main site and two blogs – implementation
- How to have dynamic sidebar content per post
- How to list custom post types in a secondary sidebar?
- From what hook on is it possible to conditionally add actions?
- Dividing widgets in sidebar?
- Post thumbnails in sidebar & footer?
- Paging in a sidebar mini loop
- How to add an entry to the Page/Post Settings Sidebar? [duplicate]
- When I try to login in wordpress it is showing “USER Doesn’t Exists”
- Programmatic Login from 3rd Party site