Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying all pages.
  4. * This is the template that displays all pages by default.
  5. * Please note that this is the WordPress construct of pages
  6. * and that other 'pages' on your WordPress site will use a
  7. * different template.
  8. *
  9. * @package The7
  10. * @since 1.0.0
  11. */
  12.  
  13. // File Security Check
  14. if ( ! defined( 'ABSPATH' ) ) {
  15. exit;
  16. }
  17.  
  18. $config = presscore_config();
  19. $config->set( 'template', 'page' );
  20.  
  21. get_header();
  22. ?>
  23.  
  24. <?php if ( presscore_is_content_visible() ): ?>
  25.  
  26. <div id="content" class="content" role="main">
  27.  
  28. <?php
  29. if ( has_post_thumbnail() ) {
  30. $thumbnail_id = get_post_thumbnail_id();
  31. $video_url = esc_url( get_post_meta( $thumbnail_id, 'dt-video-url', true ) );
  32.  
  33. if ( ! $video_url ) {
  34. $thumb_args = array(
  35. 'class' => 'alignnone',
  36. 'img_id' => $thumbnail_id,
  37. 'wrap' => '<img %IMG_CLASS% %SRC% %SIZE% %IMG_TITLE% %ALT% />',
  38. 'echo' => false,
  39. );
  40.  
  41. // Thumbnail proportions.
  42. if ( 'resize' === of_get_option( 'blog-thumbnail_size' ) ) {
  43. $prop = of_get_option( 'blog-thumbnail_proportions' );
  44. $width = max( absint( $prop['width'] ), 1 );
  45. $height = max( absint( $prop['height'] ), 1 );
  46.  
  47. $thumb_args['prop'] = $width / $height;
  48. }
  49.  
  50. $post_media_html = presscore_get_blog_post_fancy_date();
  51. if ( $config->get_bool( 'post.fancy_category.enabled' ) ) {
  52. $post_media_html .= presscore_get_post_fancy_category();
  53. }
  54.  
  55. $post_media_html .= dt_get_thumb_img( $thumb_args );
  56. } else {
  57. $post_media_html = '<div class="post-video alignnone">' . dt_get_embed( $video_url ) . '</div>';
  58. }
  59.  
  60. echo '<div class="post-thumbnail">' . $post_media_html . '</div>';
  61. }
  62. if ( have_posts() ) {
  63. while ( have_posts() ) {
  64. the_post();
  65. do_action( 'presscore_before_loop' );
  66. the_content();
  67. wp_link_pages( array(
  68. 'before' => '<div class="page-links">' . __( 'Pages:', 'the7mk2' ),
  69. 'after' => '</div>',
  70. ) );
  71. presscore_display_share_buttons_for_post( 'page' );
  72. comments_template( '', true );
  73. }
  74. } else {
  75. get_template_part( 'no-results', 'page' );
  76. }
  77. ?>
  78.  
  79. </div><!-- #content -->
  80.  
  81. <?php do_action( 'presscore_after_content' ) ?>
  82.  
  83. <?php endif // if content visible ?>
  84.  
  85. <?php get_footer() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement