Skip to content
Browse files

Post format: Image

New loop-image.php for 'image' format posts.
  • Loading branch information...
1 parent 1729e51 commit 673ea6e6df626ad0c05c5f02be32f8db41173be8 @jayj committed Sep 29, 2012
Showing with 132 additions and 75 deletions.
  1. +0 −11 functions/post-formats.php
  2. +26 −62 less/post-formats.less
  3. +78 −0 loop-image.php
  4. +28 −2 style.dev.css
View
11 functions/post-formats.php
@@ -56,17 +56,6 @@ function cakifo_link_entry_meta( $meta ) {
}
/**
- * Change entry meta for the Image post format.
- *
- * @param string $meta The normal entry meta
- * @return string The changed entry meta
- * @since Cakifo 1.1
- */
-function cakifo_image_entry_meta( $meta ) {
- return do_shortcode( '<footer class="entry-meta">' . __( '<div>[entry-published] by [entry-author] [entry-edit-link before="<br/>"]</div> <div>[entry-terms taxonomy="category" before="Posted in "] [entry-terms before="<br />Tagged "] [entry-comments-link before="<br />"]</div>', 'cakifo' ) . '</footer>' );
-}
-
-/**
* Filters the content of the link format posts. Wraps the content in the make_clickable() function
* so that users can enter just a URL into the post content editor.
*
View
88 less/post-formats.less
@@ -72,7 +72,7 @@
.chat-speaker-5 .chat-author { color: #1a1eb6; }
/**
- * Format: status
+ * Format: Status
*/
.format-status .entry-header {
margin-bottom: 5px;
@@ -124,68 +124,32 @@
}
-/* Image post format */
-.format-image .entry-content {
- padding-top: 10px;
-}
-
-.format-image p,
-.format-image p img {
- margin-bottom: 0;
-}
-
+/**
+ * Format: Image
+ */
.format-image .entry-meta {
background: #e0e6e8;
- border-top: 1px solid rgba(255,255,255, 0.15);
- border-radius: 0 0 3px 3px;
- color: #606060;
- font: 14px/2 'PT Serif', Georgia, serif;
- margin-top: -7px;
- padding: 25px;
- position: relative;
-}
-
-.format-image .entry-meta div {
- display: inline-block;
- float: left;
- width: 35%;
-}
-
-.format-image .entry-meta div + div {
- float: none;
- width: 65%;
-}
-
-.format-image .entry-meta a {
- color: #333;
- text-shadow: 0 1px 0 #edf1f2;
-}
-
-.format-image .entry-meta a:hover {
- color: #cd3907;
-}
-
-#content .format-image img {
- border: none;
border-radius: 3px;
- max-width: 100%;
- padding: 0;
-}
-
-.format-image .wp-caption {
- background: #111;
- border: none;
- border-radius: 5px 5px 0 0;
- width: 100%!important;
- margin-bottom: 0;
- padding: 13px;
-}
-
-.format-image .wp-caption .wp-caption-text {
- color: #ddd;
- padding: 20px 0 17px;
-}
-
-.format-image a:hover img {
- opacity: 0.8;
+ color: @gray;
+ #font > .alternative(14px, normal, 2);
+ padding: @smallGutterWidth;
+
+ // Entry meta columns
+ .entry-meta-col {
+ display: inline-block;
+ float: left;
+ width: 40%;
+ }
+
+ .entry-meta-col + .entry-meta-col {
+ float: none;
+ width: 60%;
+ }
+
+ // Display them on their own line
+ .comments-link,
+ .edit,
+ .category {
+ display: block;
+ }
}
View
78 loop-image.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Image Content Template
+ *
+ * Template used to show posts with the 'image' post format.
+ *
+ * This can be overridden in child themes with loop-image.php
+ *
+ * @package Cakifo
+ * @subpackage Template
+ * @since Cakifo 1.5
+ */
+?>
+<?php do_atomic( 'before_entry' ); //cakifo_before_entry ?>
+
+ <article id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
+
+ <?php do_atomic( 'open_entry' ); //cakifo_open_entry ?>
+
+ <?php if ( is_singular() && is_main_query() ) : ?>
+
+ <header class="entry-header">
+ <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title permalink=""]' ); ?>
+ <?php echo apply_atomic_shortcode( 'post_format_link', '[post-format-link]' ); ?>
+ </header> <!-- .entry-header -->
+
+ <div class="entry-content">
+ <?php
+ /* Get content if it exists */
+ if ( cakifo_post_has_content() ) {
+ the_content();
+ } else {
+ /* Get full size version of the "Featured Image" */
+ get_the_image( array( 'image_class' => 'aligncenter', 'size' => 'full', 'meta_key' => false, 'link_to_post' => false ) );
+ }
+ ?>
+
+ <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'cakifo' ), 'after' => '</p>' ) ); ?>
+ </div> <!-- .entry-content -->
+
+ <footer class="entry-meta">
+ <?php echo apply_atomic_shortcode( 'byline_image', '<div class="entry-meta-col">' . __( '[entry-published] by [entry-author] [entry-edit-link]', 'cakifo' ) . '</div>' ); ?>
+ <?php echo apply_atomic_shortcode( 'entry_meta_image', '<div class="entry-meta-col">' . __( '[entry-terms taxonomy="category" before="Posted in "] [entry-terms before="Tagged: "]', 'cakifo' ) . '</div>' ); ?>
+ </footer> <!-- .entry-meta -->
+
+ <?php do_atomic( 'in_singular' ); // cakifo_in_singular (+ cakifo_after_singular) ?>
+
+ <?php else: ?>
+
+ <header class="entry-header">
+ <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
+ <?php echo apply_atomic_shortcode( 'post_format_link', '[post-format-link]' ); ?>
+ </header> <!-- .entry-header -->
+
+ <div class="entry-content">
+ <?php
+ /* Get content if it exists */
+ if ( cakifo_post_has_content() ) {
+ the_content( __( 'Continue reading <span class="meta-nav">&raquo;</span>', 'cakifo' ) );
+ } else {
+ /* Get full size version of the "Featured Image" */
+ get_the_image( array( 'image_class' => 'aligncenter', 'size' => 'full', 'meta_key' => false, 'link_to_post' => false ) );
+ }
+ ?>
+
+ <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'cakifo' ), 'after' => '</p>' ) ); ?>
+ </div> <!-- .entry-content -->
+
+ <footer class="entry-meta">
+ <?php echo apply_atomic_shortcode( 'byline_image', '<div class="entry-meta-col">' . __( '[entry-published] by [entry-author] [entry-comments-link] ', 'cakifo' ) . '</div>' ); ?>
+ <?php echo apply_atomic_shortcode( 'entry_meta_image', '<div class="entry-meta-col">' . __( '[entry-terms taxonomy="category" before="Posted in "] [entry-terms before="Tagged: "] [entry-edit-link]', 'cakifo' ) . '</div>' ); ?>
+ </footer> <!-- .entry-meta -->
+
+ <?php endif; ?>
+
+ </article> <!-- #post-<?php the_ID(); ?> -->
+
+<?php do_atomic( 'after_entry' ); //cakifo_after_entry ?>
View
30 style.dev.css
@@ -1539,7 +1539,7 @@ html[xmlns] .slides-container {
color: #1a1eb6;
}
/**
- * Format: status
+ * Format: Status
*/
.format-status .entry-header {
margin-bottom: 5px;
@@ -1569,7 +1569,33 @@ html[xmlns] .slides-container {
/* Format: link */
/* Format: video */
/* Format: gallery */
-/* Image post format */
+/**
+ * Format: Image
+ */
+.format-image .entry-meta {
+ background: #e0e6e8;
+ border-radius: 3px;
+ color: #555555;
+ font-family: 'PT Serif', Georgia, Cambria, "Bitstream Charter", serif;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 2;
+ padding: 25px;
+}
+.format-image .entry-meta .entry-meta-col {
+ display: inline-block;
+ float: left;
+ width: 40%;
+}
+.format-image .entry-meta .entry-meta-col + .entry-meta-col {
+ float: none;
+ width: 60%;
+}
+.format-image .entry-meta .comments-link,
+.format-image .entry-meta .edit,
+.format-image .entry-meta .category {
+ display: block;
+}
/* =============================================================================
Components: Author box
========================================================================== */

0 comments on commit 673ea6e

Please sign in to comment.
Something went wrong with that request. Please try again.