Advertisement
pratikshrestha

Catch Box pro search thumbnail

Jan 20th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.00 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.                 <?php if ( has_post_thumbnail() ): ?>
  45.                     <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  46.                         <?php if ( 'no-sidebar-full-width' == $options['sidebar_layout'] ) {
  47.                             the_post_thumbnail( 'featured-slider-larger' );
  48.                         }
  49.                         else {
  50.                             the_post_thumbnail( 'featured-slider' );
  51.                         } ?>
  52.                     </a>
  53.                 <?php endif; ?>
  54.                 <?php the_excerpt(); ?>
  55.             </div><!-- .entry-summary -->
  56.         <?php elseif ( post_password_required() ) : // Password Protected Post ?>
  57.             <div class="entry-content">
  58.                 <?php
  59.                 if ( empty( $options['more_tag_accessible'] ) ) {
  60.                     $more_tag_text = $options['more_tag_text'];
  61.  
  62.                     the_content( $more_tag_text );
  63.                 }
  64.                 else {
  65.                     $more_tag_text = $options['more_tag_text_accessible'];
  66.                     $more_tag_icon = $options['more_tag_icon_accessible'];
  67.  
  68.                     the_content(
  69.                         sprintf(
  70.                            $more_tag_text,
  71.                             '<span class="screen-reader-text">  '.get_the_title().'</span>'
  72.                         ).
  73.                         $more_tag_icon
  74.                     );
  75.                 }
  76.                 ?>
  77.             </div><!-- .entry-summary -->
  78.         <?php elseif ( $current_content_layout=='excerpt' && !empty( $catchbox_excerpt ) ) : // Only display Featured Image and Excerpts if checked in Theme Option ?>
  79.             <div class="entry-summary">
  80.                 <?php if ( has_post_thumbnail() ): ?>
  81.                     <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-box-pro' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  82.                         <?php if ( 'no-sidebar-full-width' == $options['sidebar_layout'] ) {
  83.                             the_post_thumbnail( 'featured-slider-larger' );
  84.                         }
  85.                         else {
  86.                             the_post_thumbnail( 'featured-slider' );
  87.                         } ?>
  88.                     </a>
  89.                 <?php endif; ?>
  90.                 <?php the_excerpt(); ?>
  91.             </div><!-- .entry-summary -->
  92.         <?php else : ?>
  93.         <div class="entry-content">
  94.             <?php
  95.             if ( empty( $options['more_tag_accessible'] ) ) {
  96.                 $more_tag_text = $options['more_tag_text'];
  97.  
  98.                 the_content( $more_tag_text );
  99.             }
  100.             else {
  101.                 $more_tag_text = $options['more_tag_text_accessible'];
  102.                 $more_tag_icon = $options['more_tag_icon_accessible'];
  103.  
  104.                 the_content(
  105.                     sprintf(
  106.                        $more_tag_text,
  107.                         '<span class="screen-reader-text">  '. get_the_title() .'</span>'
  108.                     ).
  109.                     '<span class="meta-nav">' . $more_tag_icon . '</span>'
  110.                 );
  111.             }
  112.             ?>
  113.             <?php wp_link_pages( array(
  114.                 'before'        => '<div class="page-link"><span class="pages">' . __( 'Pages:', 'catch-box-pro' ) . '</span>',
  115.                 'after'         => '</div>',
  116.                 'link_before'   => '<span>',
  117.                 'link_after'    => '</span>',
  118.             ) );
  119.             ?>
  120.         </div><!-- .entry-content -->
  121.         <?php endif; ?>
  122.  
  123.         <footer class="entry-meta">
  124.             <?php $show_sep = false; ?>
  125.             <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
  126.             <?php
  127.                 /* translators: used between list items, there is a space after the comma */
  128.                 $categories_list = get_the_category_list( __( ', ', 'catch-box-pro' ) );
  129.                 if ( $categories_list ):
  130.             ?>
  131.             <span class="cat-links">
  132.                 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'catch-box-pro' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
  133.                 $show_sep = true; ?>
  134.             </span>
  135.             <?php endif; // End if categories ?>
  136.             <?php
  137.                 /* translators: used between list items, there is a space after the comma */
  138.                 $tags_list = get_the_tag_list( '', __( ', ', 'catch-box-pro' ) );
  139.                 if ( $tags_list ):
  140.                 if ( $show_sep ) : ?>
  141.             <span class="sep"> | </span>
  142.                 <?php endif; // End if $show_sep ?>
  143.             <span class="tag-links">
  144.                 <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'catch-box-pro' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
  145.                 $show_sep = true; ?>
  146.             </span>
  147.             <?php endif; // End if $tags_list ?>
  148.             <?php endif; // End if 'post' == get_post_type() ?>
  149.  
  150.             <?php if ( comments_open() && ( $options['commenting_setting'] != 'disable' ) && ! post_password_required() ) : ?>
  151.                 <?php if ( $show_sep ) : ?>
  152.                     <span class="sep sep-comment"> | </span>
  153.                 <?php endif; // End if $show_sep ?>
  154.                 <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>
  155.             <?php endif; // End if comments_open() ?>
  156.  
  157.             <?php edit_post_link( __( 'Edit', 'catch-box-pro' ), '<span class="edit-link">', '</span>' ); ?>
  158.         </footer><!-- #entry-meta -->
  159.     </article><!-- #post-<?php the_ID(); ?> -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement