Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Loop meta, page template authors added.

  • Loading branch information...
commit a3284f9c0167737633a43ca95d021200e656461b 1 parent 12e031f
@samikeijonen authored
Showing with 165 additions and 7 deletions.
  1. +72 −0 loop-meta.php
  2. +88 −0 page-templates/authors.php
  3. +5 −7 style.css
View
72 loop-meta.php
@@ -66,6 +66,8 @@
<div id="hcard-<?php echo esc_attr( get_the_author_meta( 'user_nicename', $user_id ) ); ?>" class="loop-meta vcard">
<h1 class="loop-title fn n"><?php the_author_meta( 'display_name', $user_id ); ?></h1>
+
+ <?php echo get_avatar( get_the_author_meta( 'user_email', $user_id ), '66' ); ?>
<div class="loop-description">
<?php echo wpautop( get_the_author_meta( 'description', $user_id ) ); ?>
@@ -127,5 +129,75 @@
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
+
+ <?php elseif ( is_page_template( 'page-templates/most-popular.php' ) ) : ?>
+
+ <div class="loop-meta">
+
+ <h1 class="loop-title"><?php _e( 'Most popular', 'path' ); ?></h1>
+
+ <div class="loop-description">
+ <p>
+ <?php _e( 'You are browsing all time most viewed articles.', 'path' ); ?>
+ </p>
+ </div><!-- .loop-description -->
+
+ </div><!-- .loop-meta -->
+
+ <?php elseif ( is_page_template( 'page-templates/most-popular-by-year.php' ) ) : ?>
+
+ <div class="loop-meta">
+
+ <h1 class="loop-title"><?php _e( 'Most popular by year', 'path' ); ?></h1>
+
+ <div class="loop-description">
+ <p>
+ <?php printf( __( 'You are browsing most viewed articles in the current year %d.', 'path' ), date( 'Y' ) ); ?>
+ </p>
+ </div><!-- .loop-description -->
+
+ </div><!-- .loop-meta -->
+
+ <?php elseif ( is_page_template( 'page-templates/most-popular-by-month.php' ) ) : ?>
+
+ <div class="loop-meta">
+
+ <h1 class="loop-title"><?php _e( 'Most popular by month', 'path' ); ?></h1>
+
+ <div class="loop-description">
+ <p>
+ <?php printf( __( 'You are browsing most viewed articles in current month (%1$s) and year (%2$s).', 'path' ), date( 'm' ), date( 'Y' ) ); ?>
+ </p>
+ </div><!-- .loop-description -->
+
+ </div><!-- .loop-meta -->
+
+ <?php elseif ( is_page_template( 'page-templates/most-popular-by-comments.php' ) ) : ?>
+
+ <div class="loop-meta">
+
+ <h1 class="loop-title"><?php _e( 'Most popular by comments', 'path' ); ?></h1>
+
+ <div class="loop-description">
+ <p>
+ <?php _e( 'You are browsing most viewed articles by comments.', 'path' ) ; ?>
+ </p>
+ </div><!-- .loop-description -->
+
+ </div><!-- .loop-meta -->
+
+ <?php elseif ( is_page_template( 'page-templates/most-popular-last-30-days.php' ) ) : ?>
+
+ <div class="loop-meta">
+
+ <h1 class="loop-title"><?php _e( 'Most popular articles in the last 30 days', 'path' ); ?></h1>
+
+ <div class="loop-description">
+ <p>
+ <?php _e( 'You are browsing most viewed articles in the last 30 days.', 'path' ) ; ?>
+ </p>
+ </div><!-- .loop-description -->
+
+ </div><!-- .loop-meta -->
<?php endif; ?>
View
88 page-templates/authors.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Template Name: Authors
+ *
+ * Displays authors who have capability to edit or publish posts or pages.
+ *
+ * @package Path
+ * @subpackage Template
+ * @since 0.1.0
+ */
+
+get_header(); // Loads the header.php template. ?>
+
+ <?php do_atomic( 'before_content' ); // path_before_content ?>
+
+ <div id="content">
+
+ <?php do_atomic( 'open_content' ); // path_open_content ?>
+
+ <div class="hfeed">
+
+ <?php get_template_part( 'loop-meta' ); // Loads the loop-meta.php template. ?>
+
+ <?php if ( have_posts() ) : ?>
+
+ <?php while ( have_posts() ) : the_post(); ?>
+
+ <?php do_atomic( 'before_entry' ); // path_before_entry ?>
+
+ <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
+
+ <?php do_atomic( 'open_entry' ); // path_open_entry ?>
+
+ <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ </div><!-- .entry-content -->
+
+ <?php $users = get_users(); ?>
+
+ <?php foreach ( $users as $author ) : ?>
+
+ <?php $user = new WP_User( $author->ID ); ?>
+
+ <?php if ( $user->has_cap( 'publish_posts' ) || $user->has_cap( 'edit_posts' ) || $user->has_cap( 'publish_pages' ) || $user->has_cap( 'edit_pages' ) ) : ?>
+
+ <div id="hcard-<?php echo str_replace( ' ', '-', get_the_author_meta( 'user_nicename', $author->ID ) ); ?>" class="author-profile vcard clear">
+
+ <a href="<?php echo get_author_posts_url( $author->ID ); ?>" title="<?php the_author_meta( 'display_name', $author->ID ); ?>">
+ <?php echo get_avatar( get_the_author_meta( 'user_email', $author->ID ), '100', '', get_the_author_meta( 'display_name', $author->ID ) ); ?>
+ </a>
+
+ <h2 class="author-name fn n">
+ <a href="<?php echo get_author_posts_url( $author->ID ); ?>" title="<?php the_author_meta( 'display_name', $author->ID ); ?>"><?php the_author_meta( 'display_name', $author->ID ); ?></a>
+ </h2>
+
+ <p class="author-bio">
+ <?php the_author_meta( 'description', $author->ID ); ?>
+ </p><!-- .author-bio -->
+
+ </div><!-- .author-profile .vcard -->
+
+ <?php endif; ?>
+
+ <?php endforeach; ?>
+
+ </div><!-- .hentry -->
+
+ <?php do_atomic( 'after_entry' ); // path_after_entry ?>
+
+ <?php endwhile; ?>
+
+ <?php else : ?>
+
+ <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
+
+ <?php endif; ?>
+
+ </div><!-- .hfeed -->
+
+ <?php do_atomic( 'close_content' ); // path_close_content ?>
+
+ </div><!-- #content -->
+
+ <?php do_atomic( 'after_content' ); // path_after_content ?>
+
+<?php get_footer(); // Loads the footer.php template. ?>
View
12 style.css
@@ -564,6 +564,8 @@ a.more-link:hover {
/* Loop meta */
.loop-meta {
+ border-bottom: 1px solid #e9edf1;
+ margin-bottom: 1em;
overflow: hidden;
}
.loop-meta .loop-title {
@@ -1258,7 +1260,7 @@ ol.comment-list {
width: 64%;
}
.custom-header #site-description {
- padding-top: 2em;
+ padding-top: 1em;
}
/* Before content sidebar. */
@@ -1421,10 +1423,10 @@ img {
/* =Layout for somewhere in the middle version
-------------------------------------------------------------- */
-@media only screen and (min-width: 55em) {
+@media only screen and (min-width: 60em) {
.custom-header #site-description {
- padding-top: 2.5em;
+ padding-top: 2em;
}
}
@@ -1434,10 +1436,6 @@ img {
@media only screen and (min-width: 70em) {
-.custom-header #site-description {
- padding-top: 3em;
-}
-
/* Comments for desktop. */
.comment-list ol.children {
margin-left: 1em;
Please sign in to comment.
Something went wrong with that request. Please try again.