# Elementor Theme Builder Condition: Logged-In Visitors

> Adds a "Logged-in visitors" display condition under Entire Site in Elementor Pro's Theme Builder, so you can show a different header or footer to members.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, theme-builder, conditions, members
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-theme-condition-logged-in/

## Code

```php
add_action( 'elementor/theme/register_conditions', function ( $conditions_manager ) {
    if ( ! class_exists( '\ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base' ) ) {
        return;
    }

    if ( ! class_exists( 'WPIDE_Elementor_Logged_In_Condition' ) ) {
        class WPIDE_Elementor_Logged_In_Condition extends \ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base {
            public static function get_type() {
                return 'general';
            }

            public function get_name() {
                return 'wpide_logged_in';
            }

            public function get_label() {
                return 'Logged-in visitors';
            }

            public function check( $args ) {
                return is_user_logged_in();
            }
        }
    }

    $general = $conditions_manager->get_condition( 'general' );

    if ( $general ) {
        $general->register_sub_condition( new WPIDE_Elementor_Logged_In_Condition() );
    }
} );
```

## Notes

Needs Elementor Pro. Re-save the template's conditions after enabling this snippet.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Elementor Theme Builder Condition: Logged-In Visitors" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
