Guest User

Check if featured image should be displayed

a guest
Nov 30th, 2012
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <div id="content" class="grid_9 <?php echo of_get_option('blog_sidebar_pos') ?>">
  3.     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  4.     <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
  5.       <article class="post-holder single-post clearfix">
  6.         <header>
  7.           <h1><?php the_title(); ?></h1>
  8.         </header>
  9.        
  10.         <?php $shouldHideFeaturedImage = get_post_meta($post->ID, 'hide_featured_image', true);
  11.             if ( $shouldHideFeaturedImage != 'yes' ) { ?>
  12.        
  13.         <?php $single_image_size = of_get_option('single_image_size'); ?>
  14.                 <?php if($single_image_size=='' || $single_image_size=='normal'){ ?>
  15.           <?php if(has_post_thumbnail()) {
  16.             echo '<figure class="featured-thumbnail"><span class="img-wrap">'; the_post_thumbnail(); echo '</span></figure>';
  17.             }
  18.           ?>
  19.         <?php } else { ?>
  20.           <?php if(has_post_thumbnail()) {
  21.             echo '<figure class="featured-thumbnail large"><span class="img-wrap"><span class="f-thumb-wrap">'; the_post_thumbnail('post-thumbnail-xl'); echo '</span></span></figure>';
  22.             }
  23.           ?>
  24.         <?php } ?>
  25.       <?php } ?>
  26.        
  27.         <div class="post-content">
  28.           <?php the_content(); ?>
  29.           <?php wp_link_pages('before=<div class="pagination">&after=</div>'); ?>
  30.         </div><!--.post-content-->
  31.       </article>
  32.  
  33.     </div><!-- #post-## -->
  34.    
  35.    
  36.     <nav class="oldernewer">
  37.       <div class="older">
  38.         <?php previous_post_link('%link', '&laquo; Previous post') ?>
  39.       </div><!--.older-->
  40.       <div class="newer">
  41.         <?php next_post_link('%link', 'Next Post &raquo;') ?>
  42.       </div><!--.newer-->
  43.     </nav><!--.oldernewer-->
  44.  
  45.     <?php comments_template( '', true ); ?>
  46.  
  47.   <?php endwhile; /* end loop */ ?>
  48. </div><!--#content-->
  49. <?php get_sidebar(); ?>
  50. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment