Advertisement
Hezze

loop-blog.php

Jun 13th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. <?php
  2. $blog_defaults = array(
  3. 'thumbnail' => '1',
  4. 'author' => '1',
  5. 'published' => '1',
  6. 'categories' => '1',
  7. 'comment_info' => '1',
  8. 'continue_btn' => '1',
  9. 'updated' => '0',
  10. 'tags' => '0',
  11. );
  12.  
  13. $blog_elements = frontier_option( 'blog_elements', array() );
  14. $blog_elements = wp_parse_args( $blog_elements, $blog_defaults );
  15. ?>
  16.  
  17. <article id="post-<?php the_ID(); ?>" <?php post_class( 'blog-view' ); ?>>
  18. <?php do_action( 'frontier_before_blog_article' ); ?>
  19.  
  20. <header class="entry-header cf">
  21. <?php do_action( 'frontier_before_blog_post_header' ); ?>
  22. <h2 class="entry-title" <?php frontier_schema( 'entry-title' ); ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  23. <?php do_action( 'frontier_after_blog_post_header' ); ?>
  24. </header>
  25.  
  26. <div class="entry-byline cf">
  27. <?php do_action( 'frontier_before_blog_post_byline' ); ?>
  28.  
  29. <?php if ( $blog_elements['author'] == 1 ) : ?>
  30. <div class="entry-author author vcard" <?php frontier_schema( 'entry-author' ); ?>>
  31. <?php $frontier_post_author_url = get_the_author_meta( 'user_url' ) != '' ? get_the_author_meta( 'user_url' ) : get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>
  32. <i class="genericon genericon-user"></i><a class="url fn" href="<?php echo esc_url( $frontier_post_author_url ); ?>" <?php frontier_schema( 'author-name' ); ?>><?php the_author(); ?></a>
  33. </div>
  34. <?php endif; ?>
  35.  
  36. <?php if ( $blog_elements['published'] == 1 ) : ?>
  37. <div class="entry-date" <?php frontier_schema( 'entry-date' ); ?>>
  38. <i class="genericon genericon-day"></i><a class="updated" href="<?php the_permalink(); ?>"><?php the_time(get_option( 'date_format' )); ?></a>
  39. </div>
  40. <?php endif; ?>
  41.  
  42. <?php if ( get_post_type() == 'post' && $blog_elements['categories'] == 1 ) : ?>
  43. <div class="entry-categories">
  44. <i class="genericon genericon-category"></i><?php the_category( ', ' ); ?>
  45. </div>
  46. <?php endif; ?>
  47.  
  48. <?php if ( $blog_elements['comment_info'] == 1 ) : ?>
  49. <div class="entry-comment-info">
  50. <i class="genericon genericon-comment"></i><a href="<?php the_permalink(); ?>#comment-area"><?php comments_number( __( 'Comments', 'frontier' ), __( '1 Comment', 'frontier' ), __( '% Comments', 'frontier' ) ); ?></a>
  51. </div>
  52. <?php endif; ?>
  53.  
  54. <?php edit_post_link( __( 'Edit', 'frontier' ), '<i class="genericon genericon-edit"></i>' ); ?>
  55.  
  56. <?php do_action( 'frontier_after_blog_post_byline' ); ?>
  57. </div>
  58.  
  59. <div class="entry-content cf" <?php frontier_schema( 'entry-content' ); ?>>
  60. <?php do_action( 'frontier_before_blog_post_content' ); ?>
  61.  
  62. <?php if ( frontier_option( 'blog_display', 'excerpt' ) == 'excerpt' ) : ?>
  63.  
  64. <div class="entry-excerpt"><?php the_excerpt(); ?></div>
  65.  
  66. <?php else : ?>
  67.  
  68. <?php the_content(); ?>
  69.  
  70. <?php endif; ?>
  71.  
  72. <?php wp_link_pages( array(
  73. 'before' => '<div class="page-nav">' . __( '<span>Pages</span>', 'frontier' ),
  74. 'after' => '</div>',
  75. 'link_before' => '<span>',
  76. 'link_after' => '</span>',
  77. 'next_or_number' => 'number',
  78. 'nextpagelink' => __( 'Next page', 'frontier' ),
  79. 'previouspagelink' => __( 'Previous page', 'frontier' ),
  80. 'pagelink' => '%',
  81. 'echo' => 1 ) );
  82. ?>
  83.  
  84. <?php do_action( 'frontier_after_blog_post_content' ); ?>
  85. </div>
  86.  
  87. <footer class="entry-footer cf">
  88. <?php do_action( 'frontier_before_blog_post_footer' ); ?>
  89.  
  90. <?php if ( frontier_option( 'blog_display', 'excerpt' ) == 'excerpt' ) : ?>
  91.  
  92. <?php if ( $blog_elements['continue_btn'] == 1 ) : ?>
  93. <a href="<?php the_permalink(); ?>" class="continue-reading">
  94. <?php $frontier_continue_reading_text = ( get_post_type() == 'page' ) ? __( 'Read Page', 'frontier' ) : __( 'Read Post', 'frontier' ); ?>
  95. <?php echo apply_filters( 'frontier_continue_reading_text', $frontier_continue_reading_text ); ?>
  96. </a>
  97. <?php endif; ?>
  98.  
  99. <?php endif; ?>
  100.  
  101. <?php if ( $blog_elements['updated'] == 1 ) : ?>
  102. <div class="entry-updated updated">
  103. <?php printf( __( 'Updated: %1$s &mdash; %2$s', 'frontier' ), get_the_modified_date(), get_the_modified_time() ); ?>
  104. </div>
  105. <?php endif; ?>
  106.  
  107. <?php if ( get_post_type() == 'post' && $blog_elements['tags'] == 1 ) : ?>
  108. <div class="entry-tags"><?php the_tags(); ?></div>
  109. <?php endif; ?>
  110.  
  111. <?php do_action( 'frontier_after_blog_post_footer' ); ?>
  112. </footer>
  113.  
  114. <?php do_action( 'frontier_after_blog_article' ); ?>
  115. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement