Switch Elements for Logged In Users

Elementor

Allows you to switch header, footer, etc. for users who are logged in.

Add the PHP code below into the desired GeneratePress Premium GP Hooks location. Don’t forget to tick the Execute PHP checkbox.

This example is using the shortcode from the AnyWhere Elementor plugin. If you have Elementor Pro, you can use that with the shortcode in the format of [elementor-template id="xxx"] Substitute XXX with your IDs.

<?php
if ( is_user_logged_in ( ) ) {
    echo do_shortcode( '[INSERT_ELEMENTOR id=XXX]' ); 
} else {
    echo do_shortcode( '[INSERT_ELEMENTOR id=XXX]' );
}
?>

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *