Guest User

Untitled

a guest
Jan 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. <?php if ( is_home() ) : ?>
  2. <div id="primary" class="content-area <?php echo ( get_theme_mod( 'nikkon-blog-full-width', false ) ) ? sanitize_html_class( 'content-area-full' ) : ''; ?>">
  3. <?php else : ?>
  4. <div id="primary" class="content-area">
  5. <?php endif; ?>
  6.  
  7. <div class="tab-content clearfix">
  8. <?php
  9. $categories = get_categories( array( 'orderby' => 'term_id', 'order' => 'ASC',) );
  10.  
  11. $i=0;
  12. $_active = '';
  13. foreach ( $categories as $category ) {
  14. $_active = ($i == 0 ? ' active' : '');
  15. echo "n";
  16. echo sprintf('<div class="tab-pane%s" id="%s">',
  17. $_active, str_replace( ' ', '-', strtolower( $category->cat_name ) )
  18. );
  19. echo "n";
  20. $_loop = new WP_Query( array(
  21. 'post_type' => 'post',
  22. 'post_status' => 'publish',
  23. 'cat' => $category->term_id,
  24. 'paged' => $paged
  25. ) );
  26.  
  27. echo "n";
  28. echo '<main id="main" class="site-main" role="main">';
  29. echo "n";
  30.  
  31. get_template_part( '/templates/titlebar' );
  32.  
  33. if ( $_loop->have_posts() ):
  34.  
  35. echo "n<!--//**************** BEGIN POSTS ***************************//-->n";
  36.  
  37. //original:
  38. // <div class="blog-blocks-wrap blog-blocks-wrap-remove blog-columns-three blog-style-postblock">
  39. //echo ( get_theme_mod( 'nikkon-blog-layout' ) == 'blog-blocks-layout' ) ? '<div class="blog-blocks-wrap blog-blocks-wrap-remove blog-columns-three ' . sanitize_html_class( $blog_style ) . '">' : '';
  40. echo '<div class="blog-blocks-wrap blog-columns-three blog-style-postblock">';
  41.  
  42. // original:
  43. // <div class="blog-blocks-wrap-inner">
  44. //echo ( get_theme_mod( 'nikkon-blog-layout' ) == 'blog-blocks-layout' ) ? '<div class="blog-blocks-wrap-inner">' : '';
  45. echo '<div>';
  46.  
  47. while ( $_loop->have_posts() ) : $_loop->the_post();
  48.  
  49. get_template_part( 'templates/contents/content' );
  50.  
  51. endwhile;
  52.  
  53. echo ( get_theme_mod( 'nikkon-blog-layout' ) == 'blog-blocks-layout' ) ? '<div class="clearboth"></div></div>' : '';
  54.  
  55. echo ( get_theme_mod( 'nikkon-blog-layout' ) == 'blog-blocks-layout' ) ? '</div>' : '';
  56.  
  57. echo "n<!--//**************** END POSTS ***************************//-->n";
  58.  
  59. else:
  60.  
  61. get_template_part( 'templates/contents/content', 'none' );
  62.  
  63. endif;
  64.  
  65. echo "n";
  66. echo '</main>';
  67.  
  68. echo "n";
  69. echo '</div>';
  70. echo "n";
  71. $i++;
  72. }
  73. ?>
  74. </div>
  75.  
  76. <!-- posts pagination -->
  77. <?php wp_pagenavi(); ?>
Add Comment
Please, Sign In to add comment