Advertisement
Guest User

functions.php

a guest
Jun 5th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package Wordspop
  4. * @subpackage Fotofolio_Landscape
  5. */
  6.  
  7. add_theme_support('webfont');
  8.  
  9. /**
  10. * Load initial WPop script
  11. */
  12. require_once dirname(__FILE__) . '/libs/wpop/init.php';
  13.  
  14. function the_post_thumbnail_caption() {
  15. global $post;
  16.  
  17. $thumb_id = get_post_thumbnail_id($post->id);
  18.  
  19. $args = array(
  20. 'post_type' => 'attachment',
  21. 'post_status' => null,
  22. 'post_parent' => $post->ID,
  23. 'include' => $thumb_id
  24. );
  25.  
  26. $thumbnail_image = get_posts($args);
  27.  
  28. if ($thumbnail_image && isset($thumbnail_image[0])) {
  29. //show thumbnail title
  30. echo $thumbnail_image[0]->post_title;
  31.  
  32. //Uncomment to show the thumbnail caption
  33. //echo $thumbnail_image[0]->post_excerpt;
  34.  
  35. //Uncomment to show the thumbnail description
  36. //echo $thumbnail_image[0]->post_content;
  37.  
  38. //Uncomment to show the thumbnail alt field
  39. //$alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
  40. //if(count($alt)) echo $alt;
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement