Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save humayunahmed8/7e583394f1c5bd2a21d1e08b48869101 to your computer and use it in GitHub Desktop.
Save humayunahmed8/7e583394f1c5bd2a21d1e08b48869101 to your computer and use it in GitHub Desktop.
Show conditional blog single page with elementor
<?php
$elementor_page = false;
if (class_exists('\Elementor\Plugin')) {
$elementor_page = \Elementor\Plugin::$instance->db->is_built_with_elementor(get_the_ID());
}
if ( $elementor_page ) :
// Elementor templates content goes here.
while ( have_posts() ) : the_post();
the_content();
endwhile;
else : ?>
// Single blog page (single.php) content goes here...
<?php while ( have_posts() ) : the_post(); ?>
<?php
the_title();
the_content();
?>
<?php endwhile; ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment