Created
July 8, 2021 17:14
-
-
Save jreviews/7ef92fffa0b0bed3e9b9853c592b043c to your computer and use it in GitHub Desktop.
Hello Elementor Theme Support for JReviews
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 | |
namespace JReviews\ThemeSupport; | |
defined( 'ABSPATH' ) || exit; | |
class HelloElementor | |
{ | |
public static function init() | |
{ | |
add_action( 'jreviews_template:before_content', [ __CLASS__, 'output_content_wrapper_open' ] ); | |
add_action( 'jreviews_template:after_content', [ __CLASS__, 'output_content_wrapper_close' ] ); | |
} | |
public static function output_content_wrapper_open() | |
{ | |
get_header(); | |
echo <<<HTML | |
<div class="elementor elementor-location-single"> | |
<div class="elementor-section-wrap"> | |
<div class="elementor-element elementor-section elementor-section-boxed"> | |
<div class="elementor-container"> | |
<div><!-- break the elementor container flex--> | |
HTML; | |
} | |
public static function output_content_wrapper_close() | |
{ | |
global $post; | |
if ( $post && (comments_open() || get_comments_number()) ) | |
{ | |
comments_template(); | |
} | |
echo '</div></div></div></div></div>'; | |
echo get_sidebar(); | |
echo get_footer(); | |
} | |
} | |
HelloElementor::init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment