Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created May 28, 2020 01:00
Show Gist options
  • Save digisavvy/ed308d57b6b334d91001adb338ebd8bd to your computer and use it in GitHub Desktop.
Save digisavvy/ed308d57b6b334d91001adb338ebd8bd to your computer and use it in GitHub Desktop.
A simple check if the current page is using ELementor
<?php // Do not include this line.
$post_id = get_the_ID(); // Set post ID var.
if ( Elementor\Plugin::instance()->db->is_built_with_elementor( $post_id ) ) {
echo 'fuck yeah it is!';
}
@abdoljabbar
Copy link

thank you for your code but is_built_with_elementor is deprecated

@digisavvy
Copy link
Author

@abdoljabbar do you have a recommendation on what to use instead?

@agileware-fj
Copy link

Elementor\Plugin::instance()->documents->get( $post_id )->is_built_with_elementor() works for me

@gilad905
Copy link

gilad905 commented Apr 5, 2022

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment