Advertisement
pratikshrestha

Clean Journal Update Child theme archive image size

Jan 1st, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. /**
  2.  * Template for Featured Image in Archive Content
  3.  *
  4.  * @override function from child theme
  5.  */
  6. function clean_journal_archive_content_image() {
  7.     $options            = clean_journal_get_theme_options();
  8.  
  9.     $featured_image = $options['content_layout'];
  10.  
  11.     if ( has_post_thumbnail() && 'full-content' != $featured_image ) { ?>
  12.         <figure class="featured-image">
  13.             <a rel="bookmark" href="<?php the_permalink(); ?>">
  14.             <?php
  15.                     if ( 'excerpt-image-left' == $featured_image  || 'excerpt-image-right' == $featured_image  ) {
  16.                          the_post_thumbnail( 'clean-journal-square' );
  17.                     }
  18.                     elseif ( 'excerpt-image-top' == $featured_image  ) {
  19.                          the_post_thumbnail( 'clean-journal-featured' );
  20.                     }
  21.                     elseif ( 'excerpt-full-image' == $featured_image  ) {
  22.                          the_post_thumbnail( 'full' );
  23.                     }
  24.                 ?>
  25.             </a>
  26.         </figure>
  27.     <?php
  28.     }
  29. }
  30.  
  31. /**
  32.  * Add new image size
  33.  */
  34. function clean_journal_child_add_image_size() {
  35.     add_image_size( 'clean-journal-square', 250, 250, true );
  36. }
  37. add_action( 'after_setup_theme', 'clean_journal_child_add_image_size' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement