Advertisement
Guest User

Untitled

a guest
May 16th, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.22 KB | None | 0 0
  1. <?php
  2. remove_filter( 'pre_get_posts', 'cosmo_posts_per_archive' );
  3. get_header();
  4. ?>
  5. <div id="main">
  6.  
  7. <!-- Start content -->
  8. <div class="row">
  9.  
  10. <!-- left sidebar -->
  11. <?php $left = layout::side( 'left' , 0 , 'front_page' ); ?>
  12. <div id="primary" <?php tools::primary_class( 0 , 'front_page' ); ?>>
  13. <div id="content" role="main">
  14. <?php
  15. /* if hot or new */
  16. if( isset( $_GET[ 'fp_type' ] ) ){
  17. switch( $_GET[ 'fp_type' ] ){
  18. case 'hot' : {
  19. post::hot_posts();
  20. break;
  21. }
  22. case 'news' : {
  23. post::new_posts();
  24. break;
  25. }
  26.  
  27.  
  28. default : {
  29.  
  30. if(is_user_logged_in() ){
  31. if( $_GET['fp_type'] == 'like' ){
  32. post::like();
  33. break;
  34. }
  35. }
  36. if( options::get_value( 'front_page' , 'type' ) == 'hot_posts' ){
  37. post::hot_posts();
  38. }
  39. if( options::get_value( 'front_page' , 'type' ) == 'new_posts' ){
  40. post::new_posts();
  41. }
  42. if( options::get_value( 'front_page' , 'type' ) == 'new_hot_posts' ){
  43. post::new_hot_posts();
  44. }
  45. break;
  46. }
  47. }
  48. }else{
  49. /* if not set params for hot or new */
  50. if( options::get_value( 'front_page' , 'type' ) != 'page' ){
  51. if( options::get_value( 'front_page' , 'type' ) == 'hot_posts' ){
  52. post::hot_posts( false );
  53. }
  54. if( options::get_value( 'front_page' , 'type' ) == 'new_posts' ){
  55. post::new_posts( false );
  56. }
  57. if( options::get_value( 'front_page' , 'type' ) == 'new_hot_posts' ){
  58. post::new_hot_posts( false );
  59. }
  60. $post_id = 0;
  61. }else{
  62. ?>
  63. <div <?php tools::content_class( 0 , 'front_page' ) ?>>
  64. <?php
  65. $wp_query = new WP_Query( array( 'page_id' => options::get_value( 'front_page' , 'page' ) ) );
  66.  
  67. if( $wp_query -> post_count > 0 ){
  68. foreach( $wp_query -> posts as $post ){
  69. $wp_query -> the_post();
  70. $post_id = $post -> ID;
  71. ?>
  72. <article id="post-<?php the_ID(); ?>" <?php post_class() ?>>
  73. <header class="entry-header">
  74. <h1 class="entry-title"><?php the_title(); ?></h1>
  75. <!-- post meta top -->
  76. <?php
  77. if( meta::logic( $post , 'settings' , 'meta' ) ){
  78. get_template_part( 'post-meta-top' );
  79. }
  80. ?>
  81. </header>
  82. <div class="entry-content">
  83. <?php
  84. /* if show featured image */
  85. if( options::logic( 'blog_post' , 'show_featured' ) ){
  86. if( has_post_thumbnail ( $post -> ID ) ){
  87. $src = image::thumbnail( $post -> ID , 'tlarge' );
  88. $caption = image::caption( $post -> ID );
  89. ?>
  90. <div class="featimg circle">
  91. <div class="img">
  92. <a href="<?php echo $src[0]; ?>" title="<?php echo $caption ?>" class="mosaic-overlay" rel="prettyPhoto-<?php echo $post -> ID; ?>">&nbsp;</a>
  93. <?php the_post_thumbnail( '600x200' ); ?>
  94. <?php
  95. if( strlen( trim( $caption ) ) ){
  96. ?>
  97. <p class="wp-caption-text"><?php echo $caption; ?></p>
  98. <?php
  99. }
  100. ?>
  101. </div>
  102. </div>
  103. <?php
  104. }
  105. }
  106. ?>
  107. <div class="excerpt">
  108. <?php the_content(); ?>
  109. <?php wp_link_pages(); ?>
  110. </div>
  111. </div>
  112.  
  113. <footer class="entry-footer">
  114. <div class="share">
  115. <?php get_template_part( 'social-sharing' ); ?>
  116. </div>
  117. </footer>
  118. </article>
  119. <?php
  120. }
  121. }else{
  122. /* not found page */
  123. get_template_part( 'loop' , '404' );
  124. }
  125.  
  126. ?></div><?php
  127. }
  128. }
  129. ?>
  130. </div>
  131. </div>
  132. <!-- right sidebar -->
  133. <?php layout::side( 'right' , 0 , 'front_page' ); ?>
  134. </div>
  135. </div>
  136. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement