Skip to content

Commit

Permalink
Re-add global post/page comments settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlxMedia committed Jul 21, 2018
1 parent 41ba9fc commit 683911a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions functions/theme-options.php
Expand Up @@ -81,6 +81,24 @@
'section' => 'general',
'default' => 'on',
) );
// General: Post Comments
Kirki::add_field( 'alx_theme', array(
'type' => 'switch',
'settings' => 'post-comments',
'label' => esc_attr__( 'Post Comments', 'slanted' ),
'description' => esc_attr__( 'Comments on posts', 'slanted' ),
'section' => 'general',
'default' => 'on',
) );
// General: Page Comments
Kirki::add_field( 'alx_theme', array(
'type' => 'switch',
'settings' => 'page-comments',
'label' => esc_attr__( 'Page Comments', 'slanted' ),
'description' => esc_attr__( 'Comments on pages', 'slanted' ),
'section' => 'general',
'default' => 'off',
) );
// General: Recommended Plugins
Kirki::add_field( 'slanted_theme', array(
'type' => 'switch',
Expand Down
2 changes: 1 addition & 1 deletion page-templates/child-menu.php
Expand Up @@ -19,7 +19,7 @@

</article>

<?php if ( comments_open() || get_comments_number() ) : comments_template( '/comments.php', true ); endif; ?>
<?php if ( get_theme_mod( 'page-comments', 'off' ) == 'on' ) { comments_template('/comments.php',true); } ?>

<?php endwhile; ?>

Expand Down
2 changes: 1 addition & 1 deletion page.php
Expand Up @@ -14,7 +14,7 @@

</article>

<?php if ( comments_open() || get_comments_number() ) : comments_template( '/comments.php', true ); endif; ?>
<?php if ( get_theme_mod( 'page-comments', 'off' ) == 'on' ) { comments_template('/comments.php',true); } ?>

<?php endwhile; ?>

Expand Down
2 changes: 1 addition & 1 deletion single.php
Expand Up @@ -42,7 +42,7 @@

<?php if ( get_theme_mod( 'related-posts', 'categories' ) != 'disable' ) { get_template_part('inc/related-posts'); } ?>

<?php if ( comments_open() || get_comments_number() ) : comments_template( '/comments.php', true ); endif; ?>
<?php if ( get_theme_mod( 'post-comments', 'on' ) == 'on' ) { comments_template('/comments.php',true); } ?>

</div><!--/.pad-->
</div><!--/.content-->
Expand Down

0 comments on commit 683911a

Please sign in to comment.