Guest User

caption

a guest
Feb 27th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. function clean_journal_archive_content_image() {
  2. $options = clean_journal_get_theme_options();
  3.  
  4. $featured_image = $options['content_layout'];
  5.  
  6. if ( has_post_thumbnail() && 'full-content' != $featured_image ) { ?>
  7. <figure class="featured-image">
  8. <a rel="bookmark" href="<?php the_permalink(); ?>">
  9. <?php
  10. if ( 'excerpt-image-left' == $featured_image || 'excerpt-image-right' == $featured_image ) {
  11. the_post_thumbnail( 'clean-journal-landscape' );
  12. }
  13. elseif ( 'excerpt-image-top' == $featured_image ) {
  14. the_post_thumbnail( 'clean-journal-featured' );
  15. }
  16. elseif ( 'excerpt-full-image' == $featured_image ) {
  17. the_post_thumbnail( 'full' );
  18. }
  19. ?>
  20. </a>
  21. <?php if (get_post(get_post_thumbnail_id())->post_excerpt) { // search for if the image has caption added on it ?>
  22. <span class="featured-image-caption">
  23. <?php echo wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt); // displays the image caption ?>
  24. </span>
  25. <?php } ?>
  26. </figure>
  27. <?php
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment