Skip to content

Instantly share code, notes, and snippets.

@luisgagocasas
Last active November 12, 2018 01:45
Show Gist options
  • Save luisgagocasas/97dd19c7dab481b6481d4a90e242b1b3 to your computer and use it in GitHub Desktop.
Save luisgagocasas/97dd19c7dab481b6481d4a90e242b1b3 to your computer and use it in GitHub Desktop.
how to detect with elementor if I am on the site or in the administrator - root sage - Elementor pro
<!doctype html>
<html @php(language_attributes())>
@include('partials.head')
<body @php(body_class())>
@php(do_action('get_header'))
@if (elementor_location_exits( 'header_content', true ))
@include('partials.header')
@else
@include('partials.header-home')
@endif
@yield('content')
@php(do_action('get_footer'))
@include('partials.footer')
@php(wp_footer())
</body>
</html>
// elementor_location_exits( 'header_content', true ) -> it returns 1 if I'm in the administrator or empty if I'm in the theme
// here I solve with my question if I am in the administrator shows me a view or if I am in the site shows me another view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment