CONTENT-IMAGE.PHP

Creamos el archivo content-image.php y añadimos el siguiente código:

  1. <?php
  2. /**
  3.  * The template for displaying posts in the Image Post Format on index and archive pages
  4.  *
  5.  * Learn more: http://codex.wordpress.org/Post_Formats
  6.  *
  7.  * @package WordPress
  8.  * @subpackage New_Theme
  9.  */
  10. ?>
  11. <article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>>
  12. <header class="entry-header">
  13. <hgroup>
  14. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'newtheme' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  15. <h3 class="entry-format"><?php _e( 'Image', 'newtheme' ); ?></h3>
  16. </hgroup>
  17.  
  18. <?php if ( comments_open() && ! post_password_required() ) : ?>
  19. <div class="comments-link">
  20. <?php comments_popup_link( '<span class="leave-reply">' . __( "Reply", 'newtheme' ) . '</span>', _x( '1', 'comments number', 'newtheme' ), _x( '%', 'comments number', 'newtheme' ) ); ?>
  21. </div>
  22. <?php endif; ?>
  23. </header><!-- .entry-header -->
  24.  
  25. <div class="entry-content">
  26. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'newtheme' ) ); ?>
  27. <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'newtheme' ) . '</span>', 'after' => '</div>' ) ); ?>
  28. </div><!-- .entry-content -->
  29.  
  30. <footer class="entry-meta">
  31. <div class="entry-meta">
  32. <?php
  33. printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'newtheme' ),
  34. esc_url( get_permalink() ),
  35. get_the_date( 'c' ),
  36. get_the_date(),
  37. esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  38. esc_attr( sprintf( __( 'View all posts by %s', 'newtheme' ), get_the_author() ) ),
  39. get_the_author()
  40. );
  41. ?>
  42. </div><!-- .entry-meta -->
  43. <div class="entry-meta">
  44. <?php
  45. /* translators: used between list items, there is a space after the comma */
  46. $categories_list = get_the_category_list( __( ', ', 'newtheme' ) );
  47. if ( $categories_list ):
  48. ?>
  49. <span class="cat-links">
  50. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'newtheme' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
  51. </span>
  52. <?php endif; // End if categories ?>
  53. <?php
  54. /* translators: used between list items, there is a space after the comma */
  55. $tags_list = get_the_tag_list( '', __( ', ', 'newtheme' ) );
  56. if ( $tags_list ): ?>
  57. <span class="tag-links">
  58. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'newtheme' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  59. </span>
  60. <?php endif; // End if $tags_list ?>
  61.  
  62. <?php if ( comments_open() ) : ?>
  63. <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'newtheme' ) . '</span>', __( '<b>1</b> Reply', 'newtheme' ), __( '<b>%</b> Replies', 'newtheme' ) ); ?></span>
  64. <?php endif; // End if comments_open() ?>
  65. </div><!-- .entry-meta -->
  66.  
  67. <?php edit_post_link( __( 'Edit', 'newtheme' ), '<span class="edit-link">', '</span>' ); ?>
  68. </footer><!-- #entry-meta -->
  69. </article><!-- #post-<?php the_ID(); ?> -->

Este tipo de contenido simplemente muestra una imagen y su respectivo título.

 

CONTENT-LINK.PHP

Creamos el archivo content-link.php y añadimos el siguiente código:

  1. <?php
  2. /**
  3.  * The template for displaying posts in the Link Post Format on index and archive pages
  4.  *
  5.  * Learn more: http://codex.wordpress.org/Post_Formats
  6.  *
  7.  * @package WordPress
  8.  * @subpackage New_Theme
  9.  */
  10. ?>
  11.  
  12. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  13. <header class="entry-header">
  14. <hgroup>
  15. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'newtheme' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  16. <h3 class="entry-format"><?php _e( 'Link', 'newtheme' ); ?></h3>
  17. </hgroup>
  18.  
  19. <?php if ( comments_open() && ! post_password_required() ) : ?>
  20. <div class="comments-link">
  21. <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'newtheme' ) . '</span>', _x( '1', 'comments number', 'newtheme' ), _x( '%', 'comments number', 'newtheme' ) ); ?>
  22. </div>
  23. <?php endif; ?>
  24. </header><!-- .entry-header -->
  25.  
  26. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  27. <div class="entry-summary">
  28. <?php the_excerpt(); ?>
  29. </div><!-- .entry-summary -->
  30. <?php else : ?>
  31. <div class="entry-content">
  32. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'newtheme' ) ); ?>
  33. <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'newtheme' ) . '</span>', 'after' => '</div>' ) ); ?>
  34. </div><!-- .entry-content -->
  35. <?php endif; ?>
  36.  
  37. <footer class="entry-meta">
  38. <?php newtheme_posted_on(); ?>
  39. <?php if ( comments_open() ) : ?>
  40. <span class="sep"> | </span>
  41. <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'newtheme' ) . '</span>', __( '<b>1</b> Reply', 'newtheme' ), __( '<b>%</b> Replies', 'newtheme' ) ); ?></span>
  42. <?php endif; ?>
  43. <?php edit_post_link( __( 'Edit', 'newtheme' ), '<span class="edit-link">', '</span>' ); ?>
  44. </footer><!-- #entry-meta -->
  45. </article><!-- #post-<?php the_ID(); ?> -->

Este contenido es más sencillo aún. Simplemente mostramos un link o un conjunto de estos.

 

CONTENT-QUOTE.PHP

Creamos el archivo content-quote.php y añadimos el siguiente código:

  1. <?php
  2.  
  3. <?php
  4. /**
  5.  * The default template for displaying content
  6.  *
  7.  * @package WordPress
  8.  * @subpackage New_Theme
  9.  */
  10. ?>
  11.  
  12. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  13. <header class="entry-header">
  14. <hgroup>
  15. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'newtheme' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  16. <h3 class="entry-format"><?php _e( 'Quote', 'newtheme' ); ?></h3>
  17. </hgroup>
  18.  
  19. <div class="entry-meta">
  20. <?php newtheme_posted_on(); ?>
  21. </div><!-- .entry-meta -->
  22.  
  23. <?php if ( comments_open() && ! post_password_required() ) : ?>
  24. <div class="comments-link">
  25. <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'newtheme' ) . '</span>', _x( '1', 'comments number', 'newtheme' ), _x( '%', 'comments number', 'newtheme' ) ); ?>
  26. </div>
  27. <?php endif; ?>
  28. </header><!-- .entry-header -->
  29.  
  30. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  31. <div class="entry-summary">
  32. <?php the_excerpt(); ?>
  33. </div><!-- .entry-summary -->
  34. <?php else : ?>
  35. <div class="entry-content">
  36. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'newtheme' ) ); ?>
  37. <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'newtheme' ) . '</span>', 'after' => '</div>' ) ); ?>
  38. </div><!-- .entry-content -->
  39. <?php endif; ?>
  40.  
  41. <footer class="entry-meta">
  42. <?php $show_sep = false; ?>
  43. <?php
  44. /* translators: used between list items, there is a space after the comma */
  45. $categories_list = get_the_category_list( __( ', ', 'newtheme' ) );
  46. if ( $categories_list ):
  47. ?>
  48. <span class="cat-links">
  49. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'newtheme' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  50. $show_sep = true; ?>
  51. </span>
  52. <?php endif; // End if categories ?>
  53. <?php
  54. /* translators: used between list items, there is a space after the comma */
  55. $tags_list = get_the_tag_list( '', __( ', ', 'newtheme' ) );
  56. if ( $tags_list ):
  57. if ( $show_sep ) : ?>
  58. <span class="sep"> | </span>
  59. <?php endif; // End if $show_sep ?>
  60. <span class="tag-links">
  61. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'newtheme' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  62. $show_sep = true; ?>
  63. </span>
  64. <?php endif; // End if $tags_list ?>
  65.  
  66. <?php if ( comments_open() ) : ?>
  67. <?php if ( $show_sep ) : ?>
  68. <span class="sep"> | </span>
  69. <?php endif; // End if $show_sep ?>
  70. <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'newtheme' ) . '</span>', __( '<b>1</b> Reply', 'newtheme' ), __( '<b>%</b> Replies', 'newtheme' ) ); ?></span>
  71. <?php endif; // End if comments_open() ?>
  72.  
  73. <?php edit_post_link( __( 'Edit', 'newtheme' ), '<span class="edit-link">', '</span>' ); ?>
  74. </footer><!-- #entry-meta -->
  75. </article><!-- #post-<?php the_ID(); ?> -->

Más de lo mismo, lo único que cambia es que aparece un subtítulo indicando que es una cita.

 

CONTENT-STATUS.PHP

Creamos el archivo content-status.php y añadimos el siguiente código:

  1. <?php
  2. /**
  3.  * The template for displaying posts in the Status Post Format on index and archive pages
  4.  *
  5.  * Learn more: http://codex.wordpress.org/Post_Formats
  6.  *
  7.  * @package WordPress
  8.  * @subpackage New_Theme
  9.  */
  10. ?>
  11.  
  12. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  13. <header class="entry-header">
  14. <hgroup>
  15. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'newtheme' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  16. <h3 class="entry-format"><?php _e( 'Status', 'newtheme' ); ?></h3>
  17. </hgroup>
  18.  
  19. <?php if ( comments_open() && ! post_password_required() ) : ?>
  20. <div class="comments-link">
  21. <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'newtheme' ) . '</span>', _x( '1', 'comments number', 'newtheme' ), _x( '%', 'comments number', 'newtheme' ) ); ?>
  22. </div>
  23. <?php endif; ?>
  24. </header><!-- .entry-header -->
  25.  
  26. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  27. <div class="entry-summary">
  28. <?php the_excerpt(); ?>
  29. </div><!-- .entry-summary -->
  30. <?php else : ?>
  31. <div class="entry-content">
  32. <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'newtheme_status_avatar', '65' ) ); ?></div>
  33.  
  34. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'newtheme' ) ); ?>
  35. <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'newtheme' ) . '</span>', 'after' => '</div>' ) ); ?>
  36. </div><!-- .entry-content -->
  37. <?php endif; ?>
  38.  
  39. <footer class="entry-meta">
  40. <?php newtheme_posted_on(); ?>
  41. <?php if ( comments_open() ) : ?>
  42. <span class="sep"> | </span>
  43. <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'newtheme' ) . '</span>', __( '<b>1</b> Reply', 'newtheme' ), __( '<b>%</b> Replies', 'newtheme' ) ); ?></span>
  44. <?php endif; ?>
  45. <?php edit_post_link( __( 'Edit', 'newtheme' ), '<span class="edit-link">', '</span>' ); ?>
  46. </footer><!-- #entry-meta -->
  47. </article><!-- #post-<?php the_ID(); ?> -->

En este caso se añade la imagen del perfil del autor o avatar para acompañar al contenido.