Jawn78

Untitled

Aug 22nd, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php echo thefour_entry_meta_element( 'published_date' ); ?>
  2. <h1 class="entry-title"><?php the_title(); ?></h1>
  3. <?php
  4. /**
  5. * Checks to see if the author has a Gravatar image.
  6. * @link https://tommcfarlin.com/check-if-a-user-has-a-gravatar/
  7. */
  8. $author_email = get_the_author_meta( 'user_email' );
  9. $url = 'http://www.gravatar.com/avatar/' . md5( strtolower( trim( $author_email ) ) ) . '?d=404';
  10. $headers = @get_headers( $url );
  11.  
  12. // Only show author Gravatar if available
  13. $has_avatar = preg_match( '|200|', $headers[0] );
  14. ?>
  15. <p class="entry-meta<?php echo $has_avatar ? '' : ' no-avatar'; ?>">
  16. <?php
  17. echo $has_avatar ? get_avatar( $author_email, 32 ) : '';
  18. printf(
  19. __( 'by %s &mdash; in %s.', 'thefour' ),
  20. thefour_entry_meta_element( 'author' ),
  21. get_the_category_list( ', ' )
  22. );
  23. comments_popup_link(
  24. __( 'No comment.', 'thefour' ),
  25. __( '1 Comment.', 'thefour' ),
  26. __( '% Comments.', 'thefour' ),
  27. 'comments-link',
  28. __( 'Comments are closed.', 'thefour' )
  29. );
  30.  
  31. /**
  32. * Display social sharing buttons for single posts.
  33. * For developers: you can remove these social buttons (if you want to use another plugin) by using the code:
  34. * remove_theme_support( 'thefour-social-buttons' )
  35. */
  36. if ( current_theme_supports( 'thefour-social-buttons' ) )
  37. {
  38. require_once get_template_directory() . '/inc/social-buttons.php';
  39. $social_buttons = new TheFour_Social_Buttons;
  40. $social_buttons->render();
  41. }
  42. ?>
  43. </p>
Advertisement
Add Comment
Please, Sign In to add comment