PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/catch-box/content.php

https://github.com/ActivateNY/activateny.org
PHP | 102 lines | 86 code | 7 blank | 9 comment | 17 complexity | 1b917fa3ced81cd614bc287963346c29 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * The default template for displaying content
  4. *
  5. * @package Catch Themes
  6. * @subpackage Catch_Box
  7. * @since Catch Box 1.0
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <header class="entry-header">
  12. <?php if ( is_sticky() ) : ?>
  13. <hgroup>
  14. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  15. <h3 class="entry-format"><?php _e( 'Featured', 'catchbox' ); ?></h3>
  16. </hgroup>
  17. <?php else : ?>
  18. <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
  19. <?php endif; ?>
  20. <?php if ( 'post' == get_post_type() ) : ?>
  21. <div class="entry-meta">
  22. <?php catchbox_posted_on(); ?>
  23. <?php if ( comments_open() && ! post_password_required() ) : ?>
  24. <span class="sep"> &mdash; </span>
  25. <span class="comments-link">
  26. <?php comments_popup_link(__('No Comments &darr;', 'catchbox'), __('1 Comment &darr;', 'catchbox'), __('% Comments &darr;', 'catchbox')); ?>
  27. </span>
  28. <?php endif; ?>
  29. </div><!-- .entry-meta -->
  30. <?php endif; ?>
  31. </header><!-- .entry-header -->
  32. <?php
  33. $options = catchbox_get_theme_options();
  34. $current_content_layout = $options['content_layout'];
  35. $catchbox_excerpt = get_the_excerpt();
  36. if ( is_search() ) : // Only display Excerpts for Search ?>
  37. <div class="entry-summary">
  38. <?php the_excerpt(); ?>
  39. </div><!-- .entry-summary -->
  40. <?php elseif ( $current_content_layout=='excerpt' && !empty( $catchbox_excerpt ) ) : // Only display Featured Image and Excerpts if checked in Theme Option ?>
  41. <div class="entry-summary">
  42. <?php if( has_post_thumbnail() ):?>
  43. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catchbox' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  44. <?php the_post_thumbnail('featured-slider'); ?>
  45. </a>
  46. <?php endif; ?>
  47. <?php the_excerpt(); ?>
  48. </div><!-- .entry-summary -->
  49. <?php else : ?>
  50. <div class="entry-content">
  51. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'catchbox' ) ); ?>
  52. <?php wp_link_pages( array(
  53. 'before' => '<div class="page-link"><span class="pages">' . __( 'Pages:', 'catchbox' ) . '</span>',
  54. 'after' => '</div>',
  55. 'link_before' => '<span>',
  56. 'link_after' => '</span>',
  57. ) );
  58. ?>
  59. </div><!-- .entry-content -->
  60. <?php endif; ?>
  61. <footer class="entry-meta">
  62. <?php $show_sep = false; ?>
  63. <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
  64. <?php
  65. /* translators: used between list items, there is a space after the comma */
  66. $categories_list = get_the_category_list( __( ', ', 'catchbox' ) );
  67. if ( $categories_list ):
  68. ?>
  69. <span class="cat-links">
  70. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'catchbox' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  71. $show_sep = true; ?>
  72. </span>
  73. <?php endif; // End if categories ?>
  74. <?php
  75. /* translators: used between list items, there is a space after the comma */
  76. $tags_list = get_the_tag_list( '', __( ', ', 'catchbox' ) );
  77. if ( $tags_list ):
  78. if ( $show_sep ) : ?>
  79. <span class="sep"> | </span>
  80. <?php endif; // End if $show_sep ?>
  81. <span class="tag-links">
  82. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'catchbox' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  83. $show_sep = true; ?>
  84. </span>
  85. <?php endif; // End if $tags_list ?>
  86. <?php endif; // End if 'post' == get_post_type() ?>
  87. <?php if ( comments_open() ) : ?>
  88. <?php if ( $show_sep ) : ?>
  89. <span class="sep"> | </span>
  90. <?php endif; // End if $show_sep ?>
  91. <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'catchbox' ) . '</span>', __( '<b>1</b> Reply', 'catchbox' ), __( '<b>%</b> Replies', 'catchbox' ) ); ?></span>
  92. <?php endif; // End if comments_open() ?>
  93. <?php edit_post_link( __( 'Edit', 'catchbox' ), '<span class="edit-link">', '</span>' ); ?>
  94. </footer><!-- #entry-meta -->
  95. </article><!-- #post-<?php the_ID(); ?> -->