Permalink
Browse files

Change styling for the status format

This is the first format to be changed in Cakifo 1.5.

* The status format now has a loop-status.php file
* The author, avatar, date and post format link is showing in
.entry-header on non-singular views
* The avatar and name is showed in the header on singular views
* Reverts 692e949
  • Loading branch information...
1 parent 52079bb commit 0ec026efb423ecda3fc7f5646571529d71805e13 @jayj committed Sep 21, 2012
Showing with 126 additions and 660 deletions.
  1. +0 −2 functions.php
  2. +0 −35 functions/post-formats.php
  3. +79 −0 loop-status.php
  4. +1 −577 style.css
  5. +46 −46 style.dev.css
View
@@ -157,8 +157,6 @@ function cakifo_theme_setup() {
add_filter( "{$prefix}_byline_quote", '__return_false' );
add_filter( "{$prefix}_byline_aside", '__return_false' );
add_filter( "{$prefix}_byline_link", '__return_false' );
- add_filter( "{$prefix}_byline_status", '__return_false' );
- add_filter( "{$prefix}_entry_meta_status", '__return_false' );
add_filter( "{$prefix}_byline_image", '__return_false' );
/* Excerpt read more link */
View
@@ -19,9 +19,6 @@
/* Auto-add paragraphs to the chat text. */
add_filter( 'post_format_chat_text', 'wpautop' );
-/* Filter the content of status posts */
-add_filter( 'the_content', 'cakifo_format_status_content' );
-
/**
* Change entry meta for the Quote post format.
*
@@ -243,38 +240,6 @@ function cakifo_format_chat_row_id( $chat_author ) {
}
/**
- * This function filters the post content when viewing a post with the "status" post format. It formats the
- * status with a .status-content wrapper and an avatar. In case the content of the status is a embedded
- * Twitter status, it does nothing.
- *
- * @param string $content The content of the status.
- * @return string $content The formatted content of the status.
- * @since Cakifo 1.5
- */
-function cakifo_format_status_content( $content ) {
-
- /* Check if we're displaying a 'status' post. */
- if ( has_post_format( 'status' ) ) :
-
- /* Match any Twitter embeds (<blockquote class="twitter-tweet") elements. */
- preg_match( '/<blockquote class=\"twitter.*?>/', $content, $matches );
-
- /* Store the post content in the $output variable */
- $output = $content;
-
- /* If no <blockquote class="twitter-tweet"> elements were found, wrap the entire content in a div and insert an avatar. */
- if ( empty( $matches ) ) {
- $content = "\n\t\t\t\t" . '<div class="note status-content">';
- $content .= "\n\t\t\t\t\t" . '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '">' . get_avatar( get_the_author_meta( 'ID' ), apply_atomic( 'status_avatar', '48' ) ) . '</a>';
- $content .= "\n\t\t\t\t\t" . $output;
- $content .= "\n\t\t\t\t" . '</div> <!-- .status-content -->';
- }
- endif;
-
- return $content;
-}
-
-/**
* Retrieves embedded videos from the post content. This script only searches for embeds used by
* the WordPress embed functionality.
*
View
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Status Content Template
+ *
+ * Template used to show posts with the 'status' post format.
+ *
+ * This can be overridden in child themes with loop-status.php
+ *
+ * @package Cakifo
+ * @subpackage Template
+ * @since Cakifo 1.5
+ */
+
+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 clearfix">
+ <?php echo get_avatar( get_the_author_meta( 'email' ), apply_atomic( 'status_avatar', 48 ) ); ?>
+ <?php echo do_shortcode( '[entry-author before="<h1>" after="</h1>"]' ); ?>
+ </header> <!-- .entry-header -->
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'cakifo' ), 'after' => '</p>' ) ); ?>
+ </div> <!-- .entry-content -->
+
+ <?php echo apply_atomic_shortcode( 'entry_meta_status', '<footer class="entry-meta">' . __( '[post-format-link] published on [entry-published] [entry-edit-link before="| "]<br />[entry-terms taxonomy="category" before="Posted in "] [entry-terms before="Tagged "]', 'cakifo' ) . '</footer>' ); ?>
+
+ <?php
+ // Loads the sidebar-after-single.php template
+ get_sidebar( 'after-single' );
+
+ // Loads the sidebar-after-singular.php template
+ get_sidebar( 'after-singular' );
+
+ do_atomic( 'after_singular' ); // cakifo_after_singular
+
+ // Loads the loop-nav.php template
+ get_template_part( 'loop-nav' );
+
+ // Loads the comments.php template
+ comments_template( '/comments.php', true );
+ ?>
+
+ <?php else: ?>
+
+ <header class="entry-header clearfix">
+ <?php echo get_avatar( get_the_author_meta( 'ID' ), apply_atomic( 'status_avatar', 48 ) ); ?>
+
+ <?php echo do_shortcode( '[entry-author before="<h1>" after="</h1>"]' ); ?>
+
+ <h2>
+ <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
+ <?php echo do_shortcode( '[entry-published]' ); ?>
+ </a>
+ </h2>
+
+ <?php echo apply_atomic_shortcode( 'post_format_link', '[post-format-link]' ); ?>
+ </header> <!-- .entry-header -->
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?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( 'entry_meta_status', '<footer class="entry-meta">' . __( '[entry-edit-link]', 'cakifo' ) . '</footer>' ); ?>
+ </footer> <!-- .entry-meta -->
+
+ <?php endif; ?>
+
+</article> <!-- #post-<?php the_ID(); ?> -->
+
+<?php do_atomic( 'after_entry' ); //cakifo_after_entry ?>
Oops, something went wrong.

0 comments on commit 0ec026e

Please sign in to comment.