/** * Uses the $comment_type to determine which comment template should be used. Once the * template is located, it is loaded for use. * * @since 1.0 * @param $comment The comment variable * @param $args Array of arguments passed from wp_list_comments() * @param $depth What level the particular comment is */ function momtaz_comments_callback($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $GLOBALS['comment_depth'] = $depth; $GLOBALS['max_depth'] = $args['max_depth']; // Locate the template based on the $comment_type. Default to 'comment.php'. momtaz_template_part('comment', get_comment_type($comment->comment_ID)); }
* The loop displays the posts and the post content. See * http://codex.wordpress.org/The_Loop to understand it and * http://codex.wordpress.org/Template_Tags to understand * the tags used in it. * * @package Momtaz * @subpackage Template * @since Momtaz Theme 1.0 */ // If the query found some posts. if (have_posts()) { // Template: loop-meta.php momtaz_template_part('loop-meta'); // Template Zone: Before Loop Momtaz_Zones::call('loop:before'); // Loop through the query posts. while (have_posts()) { the_post(); // Setup the current post. // Template: entry,php momtaz_template_part('entry'); } // Template Zone: After Loop Momtaz_Zones::call('loop:after'); // Template: loop-nav.php momtaz_template_part('loop-nav'); // The query failed or there is not any post. } else { // Template: loop-error.php momtaz_template_part('loop-error'); }
* @since Momtaz Theme 1.0 */ // Load's directly. defined('ABSPATH') or die; /* * If the visitor has not yet entered the post password if needed * will return early without loading the comments. */ if (post_password_required()) { return; } /* If no comments are given and comments/pings are closed, return. */ if (!have_comments() && !comments_open() && !pings_open()) { return; } Momtaz_Zones::call('comments:before'); ?> <section id="comments" class="comments-area"> <?php // Load the comments-loop template. momtaz_template_part('comments-loop'); // Load the comment form. comment_form(); ?> </section> <!-- #comments --> <?php Momtaz_Zones::call('comments:after');
<?php } else { ?> <?php the_content(); ?> <?php } ?> </div> <?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'momtaz') . '</span>', 'after' => '</div>')); ?> <?php Momtaz_Zones::call('entry_content:after'); ?> </div> <!-- .entry-body --> <?php momtaz_template_part('entry-footer'); ?> </article><?php Momtaz_Zones::call('entry:after'); comments_template('/comments.php', true);
<?php Momtaz_Zones::call('comments_list:before'); ?> <ol id="comment-list" class="comment-list"> <?php wp_list_comments(array('callback' => 'momtaz_comments_callback', 'type' => isset($wp_query->comments_by_type) ? 'comment' : 'all', 'avatar_size' => 80)); ?> </ol> <!-- #comment-list --> <?php Momtaz_Zones::call('comments_list:after'); ?> <?php momtaz_template_part('comments-nav'); ?> </section> <!-- #comments-container --> <?php } if (!empty($wp_query->comments_by_type['pings'])) { // Get the pings count. $pings_count = count($wp_query->comments_by_type['pings']); ?> <section id="pings-container" class="comments-container"> <header id="pings-header" class="comments-header"> <h2 id="pings-number" class="comments-title">
?> > <h1<?php momtaz_atts('site-title', array('id' => 'site-title')); ?> > <a href="<?php echo esc_url(home_url('/')); ?> " rel="home"><?php bloginfo('name'); ?> </a> </h1> <!-- #site-title --> <h2<?php momtaz_atts('site-description', array('id' => 'site-description')); ?> > <?php bloginfo('description'); ?> </h2> <!-- #site-description --> </div> <!-- #branding --> </header><?php Momtaz_Zones::call('header:after'); momtaz_template_part('menu', 'primary');
/** * Looks for a template based on the momtaz_get_context() function. The function looks for * templates based on the context of the current page being viewed by the user. * * @since 1.0 */ function momtaz_context_template($name, $slug = '', $load = true, $_args = null) { $context = array(); foreach (array_reverse(momtaz_get_context()) as $value) { if (!empty($slug)) { $context[] = "{$slug}-{$value}"; } else { $context[] = "{$value}"; } } if (!empty($slug)) { $context[] = $slug; } return momtaz_template_part($name, $context, $load, $_args); }