Permalink
Browse files

removed $comments == 'on'

get theme layout using bigblank_theme_layout function

Signed-off-by: Norik Davtian <norik@bigemployee.com>
  • Loading branch information...
NorikDavtian committed Mar 2, 2014
1 parent f5aca58 commit 22d7bf99a1bf9a332acc8b423a5c140a7f2542f6
Showing with 41 additions and 18 deletions.
  1. +1 −1 content.php
  2. +1 −1 footer-layout.php
  3. +1 −1 functions.php
  4. +1 −12 header-layout.php
  5. +34 −0 inc/template-tags.php
  6. +1 −1 page-templates/contributors.php
  7. +1 −1 page.php
  8. +1 −1 single.php
View
@@ -27,7 +27,7 @@
<?php
if ('post' == get_post_type())
bigblank_posted_on();
if ((!post_password_required() && (comments_open() || get_comments_number())) && $comments == 'on') :
if (!post_password_required() && (comments_open() || get_comments_number())) :
?>
<span class="comments-link"><?php comments_popup_link(__('Leave a comment', 'bigblank'), __('1 Comment', 'bigblank'), __('% Comments', 'bigblank')); ?></span>
<?php
View
@@ -6,7 +6,7 @@
*/
?>
</div><!-- #main -->
<?php if ($layout == 'content-sidebar' || $layout == 'sidebar-content'): ?>
<?php if (bigblank_has_sidebar()): ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div><!-- #content -->
View
@@ -168,7 +168,7 @@ function bigblank_scripts() {
// 4. or do nothing and jQuery will load from current WordPress install
$options = bigblank_get_theme_options();
$comments = $options['page_comments'];
if (is_singular() && comments_open() && get_option('thread_comments') && $comments == 'on') {
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply', false, false, false, true);
}
wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.min.js', array('jquery'), '20140222', true);
View
@@ -3,20 +3,9 @@
* Adding layout class to our main content
* Always call get_footer('layout'); to close tags opened here.
* @todo create a function to overwrite comments open
* @todo create a function to get the layout
* @link https://codex.wordpress.org/Function_Reference/comments_open#Examples
*/
$layout = get_post_meta(get_the_ID(), 'bigblank_post_layout', true);
$options = bigblank_get_theme_options();
if (!$layout) {
$layout = $options['theme_layout'];
}
if(is_page()){
$comments = $options['page_comments'];
}
if(is_single()){
$comments = $options['post_comments'];
}
$layout = bigblank_get_layout();
?>
<div id="content" class="site-content <?php echo $layout; ?>">
<div id="main" role="main">
View
@@ -334,3 +334,37 @@ function bigblank_save_post($post_id) {
} elseif ($post_layout == 'default_layout')
delete_post_meta($post_id, 'bigblank_post_layout');
}
if (!function_exists('bigblank_get_layout')) :
/**
* get our theme layout (content, content-sidebar, sidebar-content)
*
* @return String Name of our theme layout
*/
function bigblank_get_layout() {
if(is_single() || is_page()){
$layout = get_post_meta(get_the_ID(), 'be_post_layout', true);
}
if (!$layout) {
$options = bigblank_get_theme_options();
$layout = $options['theme_layout'];
}
return $layout;
}
endif;
if (!function_exists('bigblank_has_sidebar')) :
/**
* Check layout to see if layout has a sidebar
*
* @return boolean
*/
function bigblank_has_sidebar() {
$layout = bigblank_get_layout();
return ($layout == 'content-sidebar' || $layout == 'sidebar-content');
}
endif;
@@ -20,7 +20,7 @@
</article><!-- #post-## -->
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ((comments_open() || get_comments_number()) && $comments == 'on') {
if (comments_open() || get_comments_number()) {
comments_template();
}
endwhile;
View
@@ -16,7 +16,7 @@
// Include the page content template.
get_template_part('content', 'page');
// If comments are open or we have at least one comment, load up the comment template.
if ((comments_open() || get_comments_number()) && $comments == 'on') {
if (comments_open() || get_comments_number()) {
comments_template();
}
endwhile;
View
@@ -20,7 +20,7 @@
// Previous/next post navigation.
bigblank_post_nav();
// If comments are open or we have at least one comment, load up the comment template.
if ((comments_open() || get_comments_number()) && $comments == 'on') {
if (comments_open() || get_comments_number()) {
comments_template();
}
endwhile;

0 comments on commit 22d7bf9

Please sign in to comment.