/** * 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: http://codex.wordpress.org/Template_Hierarchy * * @package uncode */ get_header(); /** * DATA COLLECTION - START * */ /** Init variables **/ $limit_width = $limit_content_width = $the_content = $main_content = $layout = $sidebar_style = $sidebar_bg_color = $sidebar = $sidebar_size = $sidebar_sticky = $sidebar_padding = $sidebar_inner_padding = $sidebar_content = $title_content = $navigation_content = $page_custom_width = $row_classes = $main_classes = $footer_classes = $generic_body_content_block = ''; $index_has_navigation = false; $post_type = $post->post_type . '_index'; $tax = (isset(get_queried_object()->term_id)) ? get_queried_object()->term_id : ''; $single_post_width = ot_get_option('_uncode_' . $post_type . '_single_width'); $single_text_length = ot_get_option('_uncode_' . $post_type . '_single_text_length'); set_query_var( 'single_post_width', $single_post_width ); if ($single_text_length !== '') set_query_var( 'single_text_length', $single_text_length ); /** Get general datas **/ $style = ot_get_option('_uncode_general_style'); $bg_color = ot_get_option('_uncode_general_bg_color'); $bg_color = ($bg_color == '') ? ' style-'.$style.'-bg' : ' style-'.$bg_color.'-bg'; /** Get page width info **/ $boxed = ot_get_option('_uncode_boxed'); if ($boxed !== 'on') { $generic_content_full = ot_get_option('_uncode_' . $post_type . '_layout_width'); if ($generic_content_full === '') { $main_content_full = ot_get_option('_uncode_body_full'); if ($main_content_full === '' || $main_content_full === 'off') $limit_content_width = ' limit-width'; } else { if ($generic_content_full === 'limit') { $generic_custom_width = ot_get_option('_uncode_' . $post_type . '_layout_width_custom'); if (is_array($generic_custom_width) && !empty($generic_custom_width)) { $page_custom_width = ' style="max-width: ' . implode("", $generic_custom_width) . ';"'; } } } } /** Collect header data **/ $page_header_type = ot_get_option('_uncode_' . $post_type . '_header'); if ($page_header_type !== '' && $page_header_type !== 'none') { $metabox_data['_uncode_header_type'] = array($page_header_type); $term_back = get_option( '_uncode_taxonomy_' . $tax ); if (isset($term_back['term_media']) && $term_back['term_media'] !== '') $featured_image = $term_back['term_media']; else $featured_image = ''; $meta_data = uncode_get_general_header_data($metabox_data, $post_type, $featured_image); $metabox_data = $meta_data['meta']; $show_title = $meta_data['show_title']; } /** Get layout info **/ $activate_sidebar = ot_get_option('_uncode_' . $post_type . '_activate_sidebar'); if ($activate_sidebar !== 'off') { $layout = ot_get_option('_uncode_' . $post_type . '_sidebar_position'); if ($layout === '') $layout = 'sidebar_right'; $sidebar = ot_get_option('_uncode_' . $post_type . '_sidebar'); $sidebar_style = ot_get_option('_uncode_' . $post_type . '_sidebar_style'); $sidebar_size = ot_get_option('_uncode_' . $post_type . '_sidebar_size'); $sidebar_sticky = ot_get_option('_uncode_' . $post_type . '_sidebar_sticky'); $sidebar_sticky = ($sidebar_sticky === 'on') ? ' sticky-element sticky-sidebar' : ''; $sidebar_fill = ot_get_option('_uncode_' . $post_type . '_sidebar_fill'); $sidebar_bg_color = ot_get_option('_uncode_' . $post_type . '_sidebar_bgcolor'); $sidebar_bg_color = ($sidebar_bg_color !== '') ? ' style-' . $sidebar_bg_color . '-bg' : ''; if ($sidebar_style === '') $sidebar_style = $style; } /** Get breadcrumb info **/ $generic_breadcrumb = ot_get_option('_uncode_' . $post_type . '_breadcrumb'); $show_breadcrumb = ($generic_breadcrumb === 'off') ? false : true; if ($show_breadcrumb) $breadcrumb_align = ot_get_option('_uncode_' . $post_type . '_breadcrumb_align'); /** Get title info **/ $generic_show_title = ot_get_option('_uncode_' . $post_type . '_title'); $show_title = ($generic_show_title === 'off') ? false : true; /** * DATA COLLECTION - END * */ $posts_counter = $wp_query->post_count; /** Build header **/ if ($page_header_type !== '' && $page_header_type !== 'none') { $get_title = uncode_archive_title(); $get_subtitle = get_queried_object()->description; $page_header = new unheader($metabox_data, $get_title, $get_subtitle); $header_html = $page_header->html; if ($header_html !== '') { echo '