Advertisement
Guest User

content.php

a guest
Aug 8th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 KB | None | 0 0
  1. <?php
  2. /**
  3. * The default template for displaying content
  4. *
  5. * @package Catch Themes
  6. * @subpackage Catch_Box_Pro
  7. * @since Catch Box Pro 1.0
  8. */
  9. //Getting data from Theme Options Panel
  10. $options = catchbox_get_options();
  11.  
  12. $current_content_layout = $options['content_layout'];
  13. $catchbox_excerpt = get_the_excerpt();
  14. ?>
  15.  
  16. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  17. <header class="entry-header">
  18. <?php if ( is_sticky() ) : ?>
  19. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  20. <h3 class="entry-format"><?php _e( 'Featured', 'catch-box-pro' ); ?></h3>
  21. <?php else : ?>
  22. <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  23. <?php endif; ?>
  24.  
  25. <?php if ( 'post' == get_post_type() ) : ?>
  26. <div class="entry-meta">
  27. <?php catchbox_posted_on(); ?>
  28. <?php if ( comments_open() && ( $options['commenting_setting'] != 'disable' ) && ! post_password_required() ) : ?>
  29. <span class="sep sep-comment"> &mdash; </span>
  30. <span class="comments-link">
  31. <?php comments_popup_link(__('Leave a reply', 'catch-box-pro'), __('1 Comment &darr;', 'catch-box-pro'), __('% Comments &darr;', 'catch-box-pro')); ?>
  32. </span>
  33. <?php endif; ?>
  34. <?php if ( $current_content_layout=='full-content' ) :
  35. catchbox_updated_on();
  36. endif; ?>
  37. </div><!-- .entry-meta -->
  38. <?php endif; ?>
  39. </header><!-- .entry-header -->
  40.  
  41. <?php
  42. if ( is_search() ) : // Only display Excerpts for Search ?>
  43. <div class="entry-summary">
  44. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  45. <?php if ( 'no-sidebar-full-width' == $options['sidebar_layout'] ) {
  46. the_post_thumbnail( 'featured-slider-larger' );
  47. }
  48. else {
  49. the_post_thumbnail( 'featured-slider' );
  50. } ?>
  51. </a>
  52. <?php the_excerpt(); ?>
  53. </div><!-- .entry-summary -->
  54. <?php elseif ( post_password_required() ) : // Password Protected Post ?>
  55. <div class="entry-content">
  56. <?php
  57. if ( empty( $options['more_tag_accessible'] ) ) {
  58. $more_tag_text = $options['more_tag_text'];
  59.  
  60. the_content( $more_tag_text );
  61. }
  62. else {
  63. $more_tag_text = $options['more_tag_text_accessible'];
  64. $more_tag_icon = $options['more_tag_icon_accessible'];
  65.  
  66. the_content(
  67. sprintf(
  68. $more_tag_text,
  69. '<span class="screen-reader-text"> '.get_the_title().'</span>'
  70. ).
  71. $more_tag_icon
  72. );
  73. }
  74. ?>
  75. </div><!-- .entry-summary -->
  76. <?php elseif ( $current_content_layout=='excerpt' && !empty( $catchbox_excerpt ) ) : // Only display Featured Image and Excerpts if checked in Theme Option ?>
  77. <div class="entry-summary">
  78. <?php if ( has_post_thumbnail() ): ?>
  79. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  80. <?php if ( 'no-sidebar-full-width' == $options['sidebar_layout'] ) {
  81. the_post_thumbnail( 'featured-slider-larger' );
  82. }
  83. else {
  84. the_post_thumbnail( 'featured-slider' );
  85. } ?>
  86. </a>
  87. <?php endif; ?>
  88. <?php the_excerpt(); ?>
  89. </div><!-- .entry-summary -->
  90. <?php else : ?>
  91. <div class="entry-content">
  92. <?php
  93. if ( empty( $options['more_tag_accessible'] ) ) {
  94. $more_tag_text = $options['more_tag_text'];
  95.  
  96. the_content( $more_tag_text );
  97. }
  98. else {
  99. $more_tag_text = $options['more_tag_text_accessible'];
  100. $more_tag_icon = $options['more_tag_icon_accessible'];
  101.  
  102. the_content(
  103. sprintf(
  104. $more_tag_text,
  105. '<span class="screen-reader-text"> '. get_the_title() .'</span>'
  106. ).
  107. '<span class="meta-nav">' . $more_tag_icon . '</span>'
  108. );
  109. }
  110. ?>
  111. <?php wp_link_pages( array(
  112. 'before' => '<div class="page-link"><span class="pages">' . __( 'Pages:', 'catch-box-pro' ) . '</span>',
  113. 'after' => '</div>',
  114. 'link_before' => '<span>',
  115. 'link_after' => '</span>',
  116. ) );
  117. ?>
  118. </div><!-- .entry-content -->
  119. <?php endif; ?>
  120.  
  121. <footer class="entry-meta">
  122. <?php $show_sep = false; ?>
  123. <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
  124. <?php
  125. /* translators: used between list items, there is a space after the comma */
  126. $categories_list = get_the_category_list( __( ', ', 'catch-box-pro' ) );
  127. if ( $categories_list ):
  128. ?>
  129. <span class="cat-links">
  130. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'catch-box-pro' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  131. $show_sep = true; ?>
  132. </span>
  133. <?php endif; // End if categories ?>
  134. <?php
  135. /* translators: used between list items, there is a space after the comma */
  136. $tags_list = get_the_tag_list( '', __( ', ', 'catch-box-pro' ) );
  137. if ( $tags_list ):
  138. if ( $show_sep ) : ?>
  139. <span class="sep"> | </span>
  140. <?php endif; // End if $show_sep ?>
  141. <span class="tag-links">
  142. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'catch-box-pro' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  143. $show_sep = true; ?>
  144. </span>
  145. <?php endif; // End if $tags_list ?>
  146. <?php endif; // End if 'post' == get_post_type() ?>
  147.  
  148. <?php if ( comments_open() && ( $options['commenting_setting'] != 'disable' ) && ! post_password_required() ) : ?>
  149. <?php if ( $show_sep ) : ?>
  150. <span class="sep sep-comment"> | </span>
  151. <?php endif; // End if $show_sep ?>
  152. <span class="comments-link"><?php comments_popup_link(__('Leave a reply', 'catch-box-pro'), __('1 Comment &darr;', 'catch-box-pro'), __('% Comments &darr;', 'catch-box-pro')); ?></span>
  153. <?php endif; // End if comments_open() ?>
  154.  
  155. <?php edit_post_link( __( 'Edit', 'catch-box-pro' ), '<span class="edit-link">', '</span>' ); ?>
  156. </footer><!-- #entry-meta -->
  157. </article><!-- #post-<?php the_ID(); ?> -->
  158.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement