Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Post formats.
Browse files Browse the repository at this point in the history
Very close on post formats. I think this is a final version for most, with an option to modify the gallery post format in the future (if needed).
  • Loading branch information
kopepasah committed May 2, 2014
1 parent 22ffd27 commit 9b3859a
Show file tree
Hide file tree
Showing 9 changed files with 529 additions and 76 deletions.
36 changes: 29 additions & 7 deletions content-audio.php
Expand Up @@ -10,14 +10,36 @@

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h2>' ); ?>
<?php if ( is_single() ) : ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'eighties' ) );
if ( $categories_list && eighties_categorized_blog() ) :
?>
<div class="entry-meta entry-meta-categories"><?php echo $categories_list; ?></div>
<?php endif; ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php else : ?>
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h2>' ); ?>
<?php endif; ?>
</header><!-- .entry-header -->

<figure class="entry-audio">
<?php eighties_post_format_audio_first_audio( get_the_ID() ); ?>
</figure><!-- .entry-audio -->
<?php if ( is_single() ) : ?>
<div class="entry-content">
<?php the_content(); ?>
<p class="entry-meta entry-meta-time">
<a href="<?php the_permalink(); ?>" rel="bookmark"><i class="fa fa-clock-o"></i><?php echo eighties_get_time_difference( get_the_date( 'Y-m-d H:i:s' ) ); ?></a>
</p>
</div><!-- .entry-content -->

<div class="entry-summary" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<?php the_tags( '<footer class="entry-footer"><div class="entry-meta entry-meta-tags">', ' ', '</div></footer><!-- .entry-footer -->' ); ?>
<?php else : ?>
<figure class="entry-audio">
<?php eighties_post_format_audio_first_audio( get_the_ID() ); ?>
</figure><!-- .entry-audio -->

<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php endif; ?>
</article><!-- #post-## -->
25 changes: 25 additions & 0 deletions content-image.php
@@ -0,0 +1,25 @@
<?php
/**
* Template for displaying video content.
*
* @package Eighties
* @author Justin Kopepasah
* @since 1.0.0
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h2>' ); ?>
</header><!-- .entry-header -->

<?php if ( has_post_thumbnail() ) : ?>
<figure class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail( 'large' ); ?></a>
</figure>
<?php endif; ?><!-- .entry-image -->

<div class="entry-summary" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
4 changes: 2 additions & 2 deletions content-status.php
Expand Up @@ -11,12 +11,12 @@

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<figure class="entry-image" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<figure class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail( 'large' ); ?></a>
</figure>
<?php endif; ?><!-- .entry-image -->

<div class="entry-summary" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->

Expand Down
35 changes: 28 additions & 7 deletions content-video.php
Expand Up @@ -10,14 +10,35 @@

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h2>' ); ?>
<?php if ( is_single() ) : ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'eighties' ) );
if ( $categories_list && eighties_categorized_blog() ) :
?>
<div class="entry-meta entry-meta-categories"><?php echo $categories_list; ?></div>
<?php endif; ?>
<?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>
<?php else : ?>
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">', '</a></h2>' ); ?>
<?php endif; ?>
</header><!-- .entry-header -->

<figure class="entry-video">
<?php eighties_post_format_video_first_video( get_the_ID() ); ?>
</figure><!-- .entry-video -->
<?php if ( is_single() ) : ?>
<div class="entry-content">
<?php the_content(); ?>
<p class="entry-meta entry-meta-time">
<a href="<?php the_permalink(); ?>" rel="bookmark"><i class="fa fa-clock-o"></i><?php echo eighties_get_time_difference( get_the_date( 'Y-m-d H:i:s' ) ); ?></a>
</p>
</div><!-- .entry-content -->
<?php the_tags( '<footer class="entry-footer"><div class="entry-meta entry-meta-tags">', ' ', '</div></footer><!-- .entry-footer -->' ); ?>
<?php else : ?>
<figure class="entry-video">
<?php eighties_post_format_video_first_video( get_the_ID() ); ?>
</figure><!-- .entry-video -->

<div class="entry-summary" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php endif; ?>
</article><!-- #post-## -->
4 changes: 2 additions & 2 deletions content.php
Expand Up @@ -18,12 +18,12 @@
</header><!-- .entry-header -->

<?php if ( has_post_thumbnail() ) : ?>
<figure class="entry-image" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<figure class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail( 'large' ); ?></a>
</figure>
<?php endif; ?><!-- .entry-image -->

<div class="entry-summary" <?php eighties_backstretch_data( get_the_ID() ); ?>>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
157 changes: 149 additions & 8 deletions less/content.less
Expand Up @@ -93,7 +93,7 @@
}
}
&-footer {
margin-top: unit( ( @spacing-base - 1.5 ), em );
margin-top: unit( ( 36 / @font-size-base ), em );
}
}

Expand Down Expand Up @@ -184,9 +184,9 @@
// Has post thumbnail
.has-post-thumbnail {
.backstretch {
background: #FFF;

img {
opacity: .1;

}
}
}
Expand Down Expand Up @@ -227,10 +227,38 @@
.js {
.blog,
.archive,
.search,
.single {
.search {
.format {
&-audio {
&-image {
&.has-post-thumbnail {
color: #FFF;
a {
color: #FFF;
}
.entry {
&-title {
font-size: 1.5em;
a {
padding: .5em;
background: @light;
border-radius: 2px;
color: @dark;
}
}
&-summary {
p {
display: inline-block;
padding: .75em;
background: @light;
border-radius: 2px;
color: @dark;
}
}
}
}
}
&-audio,
&-video {
.entry {
&-title {
font-size: 1.5em;
Expand All @@ -240,14 +268,127 @@
}
}
}
&-video {
&-status {
background: @blue;
color: #FFF;
border-bottom-color: darken( @blue, 5% );
> [class^="entry-"] {
.max-width( 540px );
}
&:hover {
// background: darken( @blue, 5% );
}
a {
color: #FFF;
&:hover {
color: darken( #FFF, 5% );
}
}
.entry {
&-title {
font-size: 1.5em;
}
&-video {
&-summary {
.font-size( 30 );
}
&-meta {
margin-bottom: 0;
margin-top: @spacing-base / 2;
color: #FFF;
}
}
}
&-aside {
background: @magenta;
border-bottom-color: darken( @magenta, 5% );
color: #FFF;
> [class^="entry-"] {
.max-width( 540px );
}
&:hover {
// background: darken( @magenta, 5% );
}
a {
color: #FFF;
&:hover {
color: darken( #FFF, 5% );
}
}
.entry {
&-title {
font-size: 1.5em;
}
&-meta {
&-categories {
margin-bottom: 1em;
a {
border-bottom: 1px solid #FFF;
.transition( ~'all 100ms linear' );
&:hover {
background: darken( @magenta, 15% );
border-bottom-color: transparent;
}
}
}
&-tags {
a {
background-color: darken( @magenta, 5% );
.transition( ~'background-color 100ms linear' );
&:hover {
background-color: darken( @magenta, 15% );
}
}
}
}
}
}
&-link {
background: @cyan;
border-bottom-color: darken( @cyan, 5% );
color: #FFF;
> [class^="entry-"] {
.max-width( 540px );
}
&:hover {
// background: darken( @cyan, 5% );
}
a {
color: #FFF;
&:hover {
color: darken( #FFF, 5% );
}
}
.entry {
&-title {
font-size: 1.5em;
}
&-meta {
margin-bottom: 1em;
}
&-summary {
a {
border-bottom: 1px solid #FFF;
.transition( ~'all 100ms linear' );
&:hover {
background: darken( @cyan, 15% );
border-bottom-color: transparent;
}
}
}
}
}
}
}
.single {
.format {
&-audio,
&-video {
.entry {
&-meta {
&-time {
margin-bottom: 0;
}
}
}
}
&-status {
Expand Down
2 changes: 1 addition & 1 deletion single.php
Expand Up @@ -14,7 +14,7 @@

<?php while ( have_posts() ) : the_post(); ?>

<?php if ( in_array( get_post_format(), array( 'aside', 'status', 'link' ) ) ) : ?>
<?php if ( in_array( get_post_format(), array( 'aside', 'status', 'link', 'video', 'audio' ) ) ) : ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php else : ?>
<?php get_template_part( 'content', 'single' ); ?>
Expand Down

0 comments on commit 9b3859a

Please sign in to comment.