Created
October 31, 2023 18:02
-
-
Save humayunahmed8/7e583394f1c5bd2a21d1e08b48869101 to your computer and use it in GitHub Desktop.
Show conditional blog single page with elementor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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