Skip to content

Instantly share code, notes, and snippets.

@jreviews
Created July 8, 2021 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jreviews/7ef92fffa0b0bed3e9b9853c592b043c to your computer and use it in GitHub Desktop.
Save jreviews/7ef92fffa0b0bed3e9b9853c592b043c to your computer and use it in GitHub Desktop.
Hello Elementor Theme Support for JReviews
<?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