Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. <?php
  2. /**
  3. * Single post content template.
  4. *
  5. * @package The7
  6. * @since 1.0.0
  7. */
  8.  
  9. // File Security Check
  10. if ( ! defined( 'ABSPATH' ) ) {
  11. exit;
  12. }
  13.  
  14. global $post;
  15.  
  16. $config = presscore_config();
  17.  
  18. $post_classes = array();
  19. if ( $config->get_bool( 'post.fancy_date.enabled' ) ) {
  20. $post_classes[] = presscore_blog_fancy_date_class();
  21. }
  22. ?>
  23.  
  24. <article id="post-<?php the_ID() ?>" <?php post_class( $post_classes ) ?>>
  25.  
  26. <?php
  27.  
  28. do_action( 'presscore_before_post_content' );
  29.  
  30. // Post media.
  31. $hide_thumbnail = (bool) get_post_meta( $post->ID, '_dt_post_options_hide_thumbnail', true );
  32.  
  33. if ( has_post_thumbnail() && ! $hide_thumbnail ) {
  34. $thumbnail_id = get_post_thumbnail_id();
  35. $video_url = esc_url( get_post_meta( $thumbnail_id, 'dt-video-url', true ) );
  36.  
  37. if ( ! $video_url ) {
  38. $thumb_args = array(
  39. 'class' => 'alignnone',
  40. 'img_id' => $thumbnail_id,
  41. 'wrap' => '<img %IMG_CLASS% %SRC% %SIZE% %IMG_TITLE% %ALT% />',
  42. 'echo' => false,
  43. );
  44.  
  45. // Thumbnail proportions.
  46. if ( 'resize' === of_get_option( 'blog-thumbnail_size' ) ) {
  47. $prop = of_get_option( 'blog-thumbnail_proportions' );
  48. $width = max( absint( $prop['width'] ), 1 );
  49. $height = max( absint( $prop['height'] ), 1 );
  50.  
  51. $thumb_args['prop'] = $width / $height;
  52. }
  53.  
  54. $post_media_html = presscore_get_blog_post_fancy_date();
  55. if ( $config->get_bool( 'post.fancy_category.enabled' ) ) {
  56. $post_media_html .= presscore_get_post_fancy_category();
  57. }
  58.  
  59. $post_media_html .= dt_get_thumb_img( $thumb_args );
  60. } else {
  61. $post_media_html = '<div class="post-video alignnone">' . dt_get_embed( $video_url ) . '</div>';
  62. }
  63.  
  64. echo '<div class="post-thumbnail">' . $post_media_html . '</div>';
  65. }
  66.  
  67. // Post content.
  68. echo '<div class="entry-content">';
  69. the_content();
  70. wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'the7mk2' ), 'after' => '</div>' ) );
  71. echo '</div>';
  72.  
  73. // Post meta.
  74. $post_meta = presscore_get_single_posted_on();
  75. if ( $config->get( 'post.meta.fields.tags' ) ) {
  76. $post_meta .= presscore_get_post_tags_html();
  77. }
  78.  
  79. if ( $post_meta ) {
  80. echo '<div class="post-meta wf-mobile-collapsed">' . $post_meta . '</div>';
  81. }
  82.  
  83. presscore_display_share_buttons_for_post( 'post' );
  84.  
  85. if ( $config->get( 'post.author_block' ) ) {
  86. presscore_display_post_author();
  87. }
  88.  
  89. presscore_display_related_posts();
  90.  
  91. do_action( 'presscore_after_post_content' );
  92. ?>
  93.  
  94. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement