Advertisement
catchmahesh

content-featured

Oct 8th, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying featured posts on the front page
  4.  *
  5.  * @package Fotografie
  6.  */
  7.  
  8. ?>
  9.  
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11.     <a class="post-thumbnail" href="<?php the_permalink(); ?>">
  12.     <?php
  13.     // Output the featured image.
  14.     if ( has_post_thumbnail() ) {
  15.         $thumbnail = 'fotografie-featured-custom';
  16.  
  17.         if ( 'fluid' === get_theme_mod( 'fotografie_layout_type' ) ) {
  18.             $thumbnail = 'fotografie-featured-fluid';
  19.         }
  20.  
  21.         $layout = get_theme_mod( 'fotografie_featured_content_layout', 'layout-three' );
  22.  
  23.         if ( 'layout-two' === $layout ) {
  24.             $thumbnail = 'fotografie-hero-image';
  25.         }
  26.  
  27.         the_post_thumbnail( $thumbnail );
  28.     } else {
  29.         echo '<a href=' . esc_url( get_permalink() ) .'><img src="' .  trailingslashit( esc_url( get_template_directory_uri() ) ) . 'assets/images/no-thumb.jpg"/></a>';
  30.     }
  31.     ?>
  32.     </a>
  33.  
  34.     <header class="entry-header">
  35.         <?php
  36.             the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h2>' );
  37.         ?>
  38.         <div class="entry-meta">
  39.             <?php fotografie_date(); ?>
  40.         </div><!-- .entry-meta -->
  41.     </header>
  42. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement