PageRenderTime 86ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/content.php

https://github.com/mohitkr05/project-ar2
PHP | 102 lines | 81 code | 17 blank | 4 comment | 14 complexity | 1781f2bf9630759b25ff213e968e4e72 MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. /**
  3. * The default template for displaying content.
  4. * @since 2.0
  5. */
  6. ?>
  7. <article id="post-<?php the_ID() ?>" <?php post_class() ?>>
  8. <header class="entry-header clearfix">
  9. <?php
  10. if ( ar2_get_theme_option( 'post_display[post_cats]' ) ) {
  11. $post_cats = array();
  12. $cats = get_the_category();
  13. foreach ( $cats as $c )
  14. $post_cats[] = '<a href="' . get_category_link( $c->cat_ID ) . '">' . $c->cat_name . '</a>';
  15. echo '<div class="entry-cats">' . implode( ', ', $post_cats ) . '</div>';
  16. }
  17. ?>
  18. <h1 class="entry-title">
  19. <?php if ( false !== get_post_format() ) : ?>
  20. <span class="entry-format"><?php echo get_post_format_string( get_post_format() ) ?></span>
  21. <?php endif ?>
  22. <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title() ?></a>
  23. </h1>
  24. <?php if ( ar2_get_theme_option( 'post_display[post_author]' ) ) : ?>
  25. <div class="entry-author">
  26. <?php printf( __( 'Posted by %1$s %2$s', 'ar2' ),
  27. '<address class="author vcard"><a rel="author" class="url fn n" href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '" title="' . esc_attr( get_the_author() ) . '">' . get_the_author() . '</a></address>',
  28. '<abbr class="published">' . ar2_posted_on( false ) . '</abbr>'
  29. ); ?>
  30. <?php edit_post_link( __( 'Edit', 'ar2' ) ) ?>
  31. </div>
  32. <?php else : ?>
  33. <div class="entry-author">
  34. <?php printf( __( 'Posted %s', 'ar2' ), '<abbr class="published">' . ar2_posted_on( false ) . '</abbr>' ); ?>
  35. <?php edit_post_link( __( 'Edit', 'ar2' ) ) ?>
  36. </div>
  37. <?php endif ?>
  38. <?php if ( ar2_get_theme_option( 'post_display[excerpt]' ) && has_excerpt() ) : ?>
  39. <div class="entry-excerpt"><?php the_excerpt() ?></div>
  40. <?php endif ?>
  41. <?php if ( ar2_get_theme_option( 'post_display[single_thumbs]' ) && has_post_thumbnail( $post->ID ) ) : ?>
  42. <div class="entry-photo"><?php echo ar2_get_thumbnail( 'single-thumb' ) ?></div>
  43. <?php endif ?>
  44. <?php if ( ar2_get_theme_option( 'post_display[post_social]' ) ) : ?>
  45. <div class="entry-social">
  46. <div class="addthis_toolbox addthis_default_style"
  47. addthis:url="<?php echo esc_attr( get_permalink( $post->ID ) ) ?>"
  48. addthis:title="<?php echo esc_attr( get_the_title() ) ?>"
  49. addthis:description="<?php the_excerpt_rss( 30, 2 ) ?>">
  50. <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
  51. <a class="addthis_button_tweet"></a>
  52. <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
  53. <a class="addthis_counter addthis_pill_style"></a>
  54. </div>
  55. </div>
  56. <?php endif ?>
  57. </header><!-- .entry-header -->
  58. <div class="entry-content clearfix">
  59. <?php the_content( __( '<p>Read the rest of this entry &raquo;</p>', 'ar2' ) ); ?>
  60. <?php wp_link_pages( array( 'before' => '<p class="post-navigation"><strong>' . __( 'Pages:', 'ar2' ) . '</strong>',
  61. 'after' => '</p>', 'next_or_number' => 'number', 'pagelink' => '<span>%</span>' ) ); ?>
  62. </div>
  63. <footer class="entry-footer clearfix">
  64. <?php if ( ar2_get_theme_option( 'post_display[post_tags]' ) && is_array( get_the_tags() ) ) : ?>
  65. <div class="entry-tags tags">
  66. <?php the_tags( '<strong>' . __( 'Tags: ', 'ar2' ) . '</strong>', ' ' ) ?>
  67. </div>
  68. <?php endif ?>
  69. <?php if ( ar2_get_theme_option( 'post_display[display_author]' ) ) : ?>
  70. <?php $id = get_the_author_meta( 'ID' ); ?>
  71. <div class="about-author clearfix">
  72. <a class="author-avatar" href="<?php get_author_posts_url( $id ) ?>"><?php echo get_avatar( $id, 64 ) ?></a>
  73. <div class="author-meta">
  74. <h4><?php printf( __( 'About %s', 'ar2' ), get_the_author_meta( 'display_name' ) ) ?></h4>
  75. <?php
  76. if ( get_the_author_meta( 'description' ) == '' )
  77. _e( 'No information is provided by the author.', 'ar2' );
  78. else
  79. the_author_meta( 'description' );
  80. ?>
  81. </div>
  82. </div>
  83. <?php endif ?>
  84. </footer><!-- .entry-footer -->
  85. </article>