Viewing File: /home/maglabs/multicerame/wp-content/themes/dom/index.php

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: //codex.wordpress.org/Template_Hierarchy
 *
 * @package DOM
 * @since DOM 1.0
 */

$dom_template = apply_filters( 'dom_filter_get_template_part', dom_blog_archive_get_template() );

if ( ! empty( $dom_template ) && 'index' != $dom_template ) {

	get_template_part( $dom_template );

} else {

	dom_storage_set( 'blog_archive', true );

	get_header();

	if ( have_posts() ) {

		// Query params
		$dom_stickies   = is_home()
								|| ( in_array( dom_get_theme_option( 'post_type' ), array( '', 'post' ) )
									&& (int) dom_get_theme_option( 'parent_cat' ) == 0
									)
										? get_option( 'sticky_posts' )
										: false;
		$dom_post_type  = dom_get_theme_option( 'post_type' );
		$dom_args       = array(
								'blog_style'     => dom_get_theme_option( 'blog_style' ),
								'post_type'      => $dom_post_type,
								'taxonomy'       => dom_get_post_type_taxonomy( $dom_post_type ),
								'parent_cat'     => dom_get_theme_option( 'parent_cat' ),
								'posts_per_page' => dom_get_theme_option( 'posts_per_page' ),
								'sticky'         => dom_get_theme_option( 'sticky_style' ) == 'columns'
															&& is_array( $dom_stickies )
															&& count( $dom_stickies ) > 0
															&& get_query_var( 'paged' ) < 1
								);

		dom_blog_archive_start();

		do_action( 'dom_action_blog_archive_start' );

		if ( is_author() ) {
			do_action( 'dom_action_before_page_author' );
			get_template_part( apply_filters( 'dom_filter_get_template_part', 'templates/author-page' ) );
			do_action( 'dom_action_after_page_author' );
		}

		if ( dom_get_theme_option( 'show_filters' ) ) {
			do_action( 'dom_action_before_page_filters' );
			dom_show_filters( $dom_args );
			do_action( 'dom_action_after_page_filters' );
		} else {
			do_action( 'dom_action_before_page_posts' );
			dom_show_posts( array_merge( $dom_args, array( 'cat' => $dom_args['parent_cat'] ) ) );
			do_action( 'dom_action_after_page_posts' );
		}

		do_action( 'dom_action_blog_archive_end' );

		dom_blog_archive_end();

	} else {

		if ( is_search() ) {
			get_template_part( apply_filters( 'dom_filter_get_template_part', 'templates/content', 'none-search' ), 'none-search' );
		} else {
			get_template_part( apply_filters( 'dom_filter_get_template_part', 'templates/content', 'none-archive' ), 'none-archive' );
		}
	}

	get_footer();
}
Back to Directory File Manager