Skip to content

Commit

Permalink
Add more checks to determine whether to display the recirculation or not
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiy committed Sep 24, 2017
1 parent e560d89 commit 7ba35f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/comments-template.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$options = SpotIM_Options::get_instance();
$front = new SpotIM_Frontend( $options );
$spot_id = $options->get( 'spot_id' );
$recirculation_method = $options->get( 'rc_embed_method' );
switch( $options->get( 'disqus_identifier' ) ) {
Expand All @@ -16,7 +17,7 @@
?>
<div class="spot-im-comments <?php echo esc_attr( apply_filters( 'spotim_comments_class', $options->get( 'class' ) ) ); ?>">
<?php
if ( 'top' === $recirculation_method ) {
if ( ( 'top' === $recirculation_method ) && ( $front->has_spotim_recirculation() ) ) {
ob_start();
include( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/recirculation-template.php' );
$recirculation = ob_get_contents();
Expand All @@ -39,7 +40,7 @@
>
</div>
<?php
if ( 'bottom' === $recirculation_method ) {
if ( ( 'bottom' === $recirculation_method ) && ( $front->has_spotim_recirculation() ) ) {
ob_start();
include( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/recirculation-template.php' );
$recirculation = ob_get_contents();
Expand Down

0 comments on commit 7ba35f4

Please sign in to comment.