Exemple #1
0
<?php 
get_template_part('module_pageTit');
get_template_part('module_panList');
?>

<div class="section siteContent">
<div class="container">
<div class="row">

<main class="col-md-8 mainSection" id="main" role="main">

 <?php 
/*-------------------------------------------*/
/*  Archive title
/*-------------------------------------------*/
$page_for_posts = lightning_get_page_for_posts();
// Use post top page( Archive title wrap to div )
if ($page_for_posts['post_top_use'] || get_post_type() != 'post') {
    if (is_year() || is_month() || is_day() || is_tag() || is_author() || is_tax() || is_category()) {
        $archiveTitle = get_the_archive_title();
        echo '<header class="archive-header"><h1>' . $archiveTitle . '</h1></header>';
    }
}
?>

<?php 
/*-------------------------------------------*/
/*  Archive description
/*-------------------------------------------*/
if (is_category() || is_tax() || is_tag()) {
    $category_description = term_description();
function lightning_get_the_archive_title()
{
    if (is_category()) {
        $title = single_cat_title('', false);
    } elseif (is_tag()) {
        $title = single_tag_title('', false);
    } elseif (is_author()) {
        $title = sprintf(__('Author: %s', 'lightning'), '<span class="vcard">' . get_the_author() . '</span>');
    } elseif (is_year()) {
        $title = get_the_date(_x('Y', 'yearly archives date format', 'lightning'));
    } elseif (is_month()) {
        $title = get_the_date(_x('F Y', 'monthly archives date format', 'lightning'));
    } elseif (is_day()) {
        $title = get_the_date(_x('F j, Y', 'daily archives date format', 'lightning'));
    } elseif (is_post_type_archive()) {
        $title = post_type_archive_title('', false);
    } elseif (is_tax()) {
        $title = single_term_title('', false);
    } elseif (is_home() && !is_front_page()) {
        $lightning_page_for_posts = lightning_get_page_for_posts();
        $title = $lightning_page_for_posts['post_top_name'];
    } else {
        global $wp_query;
        // get post type
        $postType = $wp_query->query_vars['post_type'];
        if ($postType) {
            $pageTitle = get_post_type_object($postType)->labels->name;
        } else {
            $title = __('Archives', 'lightning');
        }
    }
    return apply_filters('lightning_get_the_archive_title', $title);
}