/** * Setup the framework's theme. * * @return void * @since 1.3 */ function momtaz_theme_setup() { Momtaz_Zones::add_callback('head', 'momtaz_main_stylesheet'); Momtaz_Zones::add_callback('head', 'momtaz_locale_stylesheet'); Momtaz_Zones::add_callback('head', 'momtaz_meta_generator'); Momtaz_Zones::add_callback('head', 'momtaz_meta_designer'); }
<link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?> " /> <meta name="viewport" content="width=device-width,initial-scale=1" /> <!--[if lt IE 9]> <script src="<?php echo esc_url(momtaz_theme_uri('content/scripts/html5shiv.min.js')); ?> "></script> <![endif]--> <?php Momtaz_Zones::call('head'); ?> <!-- end Momtaz Head --> <!-- WP Head --> <?php wp_head(); ?> <!-- end WP Head --> </head> <body<?php momtaz_atts('body'); ?> >
* 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'); }
<?php /** * Index Template * * @package Momtaz * @subpackage Template * @since Momtaz Theme 1.0 */ Momtaz_Zones::add_callback('content', 'momtaz_template_content'); /** * Outputs the current template content. * * @return void * @since 1.3 */ function momtaz_template_content() { ?> <section id="primary-content"> <?php momtaz_context_template('loop'); ?> </section> <!-- #primary-content --><?php } // Load the structure template. momtaz_context_template('structure');
*/ // 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);
* This template houses the HTML used for the 'Primary' sidebar. * It will first check if the sidebar is active before displaying anything. * * @package Momtaz * @subpackage Template * @since Momtaz Theme 1.1 */ if (is_active_sidebar('primary')) { ?> <div<?php momtaz_atts('sidebar', array('id' => 'sidebar')); ?> > <?php Momtaz_Zones::call('primary_sidebar:before'); ?> <div id="primary-sidebar" class="widget-area"> <?php dynamic_sidebar('primary'); ?> </div> <!-- #primary-sidebar --> <?php Momtaz_Zones::call('primary_sidebar:after'); ?> </div><?php }
<?php /** * Primary Menu Template * * Displays the primary menu if it has active menu items. * * @package Momtaz * @subpackage Template * @since Momtaz Theme 1.0 */ if (has_nav_menu('primary')) { Momtaz_Zones::call('primary_menu:before'); ?> <nav<?php momtaz_atts('nav-primary', array('id' => 'primary-menu', 'class' => 'menu-container')); ?> > <?php wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu dropdown')); ?> </nav><?php Momtaz_Zones::call('primary_menu:after'); }
/** * Displays the theme settings page and calls do_meta_boxes() to allow additional settings * meta boxes to be added to the page. * * @return string * @since 1.2 */ public function page_content() { if (!current_user_can($this->get_capability())) { return; } Momtaz_Zones::call('settings_page:before'); ?> <div class="wrap theme-settings"> <h2> <?php echo $this->get_page_title(); ?> <a href="<?php echo esc_url(admin_url('customize.php')); ?> " class="add-new-h2"><?php esc_html_e('Customize', 'momtaz'); ?> </a> </h2> <?php settings_errors(); ?> <div class="momtaz-core-settings-wrap"> <form method="post" action="<?php echo esc_url(admin_url('options.php')); ?> "> <p class="submit"> <?php submit_button(esc_attr__('Update Settings', 'momtaz'), 'primary', 'update', false); ?> </p> <!-- .submit --> <?php settings_fields(momtaz_format_hook('theme_settings')); ?> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> <div class="metabox-holder"> <div class="post-box-container column-1 normal"> <?php do_meta_boxes(NULL, 'normal', NULL); ?> </div> <!-- .column-1 --> <div class="post-box-container column-2 side"> <?php do_meta_boxes(NULL, 'side', NULL); ?> </div> <!-- .column-2 --> <div class="post-box-container column-3 advanced"> <?php do_meta_boxes(NULL, 'advanced', NULL); ?> </div> <!-- .column-3 --> </div> <!-- .metabox-holder --> </form> <!-- Form End --> </div> <!-- .momtaz-core-settings-wrap --> </div> <!-- .wrap --> <?php Momtaz_Zones::call('settings_page:after'); }
?> </h2> <!-- #pings-number --> </header> <!-- #pings-header --> <?php Momtaz_Zones::call('pings_list:before'); ?> <ol id="ping-list" class="comment-list"> <?php wp_list_comments(array('callback' => 'momtaz_comments_callback', 'type' => 'pings')); ?> </ol> <!-- #ping-list --> <?php Momtaz_Zones::call('pings_list:after'); ?> </section> <!-- #pings-container --> <?php } } // end have_comments() if (!comments_open() && get_comments_number() > 0) { ?> <p class="alert comments-closed"> <?php _e('Comments are closed.', 'momtaz'); ?>
<?php /** * Main Header Template * * @package Momtaz * @subpackage Template * @since Momtaz Theme 1.3 */ Momtaz_Zones::call('footer:before'); ?> <footer<?php momtaz_atts('footer', array('id' => 'footer')); ?> > <p class="site-credits"><?php printf(__('Proudly powered by %1$s and %2$s Theme', 'momtaz'), momtaz_get_wp_link(), momtaz_get_theme_link(get_stylesheet())); ?> </p> </footer> <?php Momtaz_Zones::call('footer:after');
<div<?php momtaz_atts('container', array('id' => 'container')); ?> > <main<?php momtaz_atts('content', array('id' => 'content')); ?> > <?php Momtaz_Zones::call('content'); ?> </main> <!-- #content --> <?php momtaz_template_sidebar(); ?> </div> <!-- #container --> <?php Momtaz_Zones::call('container:after'); ?> <?php momtaz_template_footer('main'); ?> </div> <!-- #wrapper --><?php Momtaz_Zones::call('wrapper:after'); momtaz_template_footer();
momtaz_atts('branding', array('id' => 'branding')); ?> > <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');
/** * Registers the framework's default template zones. * * @return void * @since 1.3 */ function momtaz_register_core_zones() { $zones = array('wrapper:before' => __('Before Wrapper', 'momtaz'), 'wrapper:after' => __('After Wrapper', 'momtaz'), 'container:before' => __('Before Container', 'momtaz'), 'container:after' => __('After Container', 'momtaz'), 'content' => __('Inside Content', 'momtaz'), 'head' => __('Inside Head', 'momtaz'), 'header:before' => __('Before Header', 'momtaz'), 'header:after' => __('After Header', 'momtaz'), 'loop:before' => __('Before Loop', 'momtaz'), 'loop:after' => __('After Loop', 'momtaz'), 'entry:before' => __('Before Entry', 'momtaz'), 'entry:after' => __('After Entry', 'momtaz'), 'entry_content:before' => __('Before Entry Content', 'momtaz'), 'entry_content:after' => __('After Entry Content', 'momtaz'), 'comments:before' => __('Before Comments', 'momtaz'), 'comments:after' => __('After Comments', 'momtaz'), 'comment:before' => __('Before Comment', 'momtaz'), 'comment:after' => __('After Comment', 'momtaz'), 'comments_list:before' => __('Before Comments List', 'momtaz'), 'comments_list:after' => __('After Comments List', 'momtaz'), 'pings_list:before' => __('Before Pings List', 'momtaz'), 'pings_list:after' => __('After Pings List', 'momtaz'), 'primary_menu:before' => __('Before Primary Menu', 'momtaz'), 'primary_menu:after' => __('After Primary Menu', 'momtaz'), 'primary_sidebar:before' => __('Before Primary Sidebar', 'momtaz'), 'primary_sidebar:after' => __('After Primary Sidebar', 'momtaz'), 'footer:before' => __('Before Footer', 'momtaz'), 'footer:after' => __('After Footer', 'momtaz'), 'settings_page:before' => __('Before Settings Page', 'momtaz'), 'settings_page:after' => __('After Settings Page', 'momtaz')); foreach ($zones as $id => $args) { if (is_string($args)) { $args = array('title' => $args); } Momtaz_Zones::register($id, $args); } }