Make WordPress Themes

source: generatepress/1.2.9/archive.php

Last change on this file was 44201, checked in by themedropbox, 11 years ago

New version of GeneratePress - 1.2.9

File size: 3.5 KB
Line 
1<?php
2/**
3 * The template for displaying Archive pages.
4 *
5 * Learn more: http://codex.wordpress.org/Template_Hierarchy
6 *
7 * @package Generate
8 */
9
10get_header(); ?>
11
12        <section id="primary" <?php generate_content_class(); ?> itemprop="mainContentOfPage">
13                <main id="main" <?php generate_main_class(); ?> itemtype="http://schema.org/Blog" itemscope="itemscope" role="main">
14                <?php do_action('generate_before_main_content'); ?>
15                <?php if ( have_posts() ) : ?>
16
17                        <header class="page-header<?php if ( is_author() ) echo ' clearfix';?>">
18                                <?php do_action( 'generate_before_archive_title' ); ?>
19                                <h1 class="page-title">
20                                        <?php
21                                                if ( is_category() ) :
22                                                        single_cat_title();
23
24                                                elseif ( is_tag() ) :
25                                                        single_tag_title();
26
27                                                elseif ( is_author() ) :
28                                                        /* Queue the first post, that way we know
29                                                         * what author we're dealing with (if that is the case).
30                                                        */
31                                                        the_post();
32                                                        echo get_avatar( get_the_author_meta( 'ID' ), 75 );
33                                                        printf( __( 'About %s', 'generate' ), '<span class="vcard">' . get_the_author() . '</span>' );
34                                                        /* Since we called the_post() above, we need to
35                                                         * rewind the loop back to the beginning that way
36                                                         * we can run the loop properly, in full.
37                                                         */
38                                                        rewind_posts();
39
40                                                elseif ( is_day() ) :
41                                                        printf( __( 'Day: %s', 'generate' ), '<span>' . get_the_date() . '</span>' );
42
43                                                elseif ( is_month() ) :
44                                                        printf( __( 'Month: %s', 'generate' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
45
46                                                elseif ( is_year() ) :
47                                                        printf( __( 'Year: %s', 'generate' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
48
49                                                elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
50                                                        _e( 'Asides', 'generate' );
51
52                                                elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
53                                                        _e( 'Images', 'generate');
54
55                                                elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
56                                                        _e( 'Videos', 'generate' );
57
58                                                elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
59                                                        _e( 'Quotes', 'generate' );
60
61                                                elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
62                                                        _e( 'Links', 'generate' );
63
64                                                else :
65                                                        _e( 'Archives', 'generate' );
66
67                                                endif;
68                                        ?>
69                                </h1>
70                                <?php do_action( 'generate_after_archive_title' ); ?>
71                                <?php
72                                        // Show an optional term description.
73                                        $term_description = term_description();
74                                        if ( ! empty( $term_description ) ) :
75                                                printf( '<div class="taxonomy-description">%s</div>', $term_description );
76                                        endif;
77                                       
78                                        if ( get_the_author_meta('description') && is_author() ) : // If a user has filled out their decscription show a bio on their entries
79                                                echo '<div class="author-info">' . get_the_author_meta('description') . '</div>';
80                                        endif;
81                                ?>
82                                <?php do_action( 'generate_after_archive_description' ); ?>
83                        </header><!-- .page-header -->
84
85                        <?php /* Start the Loop */ ?>
86                        <?php while ( have_posts() ) : the_post(); ?>
87
88                                <?php
89                                        /* Include the Post-Format-specific template for the content.
90                                         * If you want to override this in a child theme, then include a file
91                                         * called content-___.php (where ___ is the Post Format name) and that will be used instead.
92                                         */
93                                        get_template_part( 'content', get_post_format() );
94                                ?>
95
96                        <?php endwhile; ?>
97
98                        <?php generate_content_nav( 'nav-below' ); ?>
99
100                <?php else : ?>
101
102                        <?php get_template_part( 'no-results', 'archive' ); ?>
103
104                <?php endif; ?>
105                <?php do_action('generate_after_main_content'); ?>
106                </main><!-- #main -->
107        </section><!-- #primary -->
108
109<?php 
110do_action('generate_sidebars');
111get_footer();
Note: See TracBrowser for help on using the repository browser.