Advertisement
Guest User

index.php

a guest
Jul 2nd, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <!-- BEGIN MAIN -->
  4. <div id="main">
  5.  
  6. <?php $fake_loop = new WP_Query('showposts=5'); while($fake_loop->have_posts()): $fake_loop->the_post(); ?>
  7. <?php endwhile; ?>
  8.  
  9. <?php if(get_option('pyre_featured_slider') == 'On' && get_option('pyre_featured_tags')): ?>
  10. <?php
  11. $post_types = get_post_types();
  12. unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);
  13.  
  14. $featured_posts = new WP_Query(array(
  15. 'post_type' => $post_types,
  16. 'showposts' => 5,
  17. 'tag' => get_option('pyre_featured_tags')
  18. ));
  19. ?>
  20. <!-- BEGIN WRAPPER-FEATURED -->
  21. <div id="wrapper-featured">
  22.  
  23. <div id="wrapper-slides">
  24.  
  25. <div id="slider" class="nivoSlider">
  26. <?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
  27. <?php if(has_post_thumbnail()): ?>
  28. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image'); ?>
  29. <?php $image_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-image-thumb'); ?>
  30. <a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php echo $image_thumb[0]; ?>" width='516' height='340' /></a>
  31. <?php else: ?>
  32. <a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=516&h=340" alt="<?php the_title(); ?>" title="#htmlcaption_<?php the_ID(); ?>" rel="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=70&h=60" width='516' height='340' /></a>
  33. <?php endif; ?>
  34. <?php endwhile; ?>
  35. </div>
  36.  
  37. <?php while($featured_posts->have_posts()): $featured_posts->the_post(); ?>
  38. <div class="nivo-html-caption" id="htmlcaption_<?php the_ID(); ?>">
  39. <h1><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h1>
  40. <p><?php echo string_limit_words(get_the_excerpt(), 15); ?> <span class="block-arrows"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'>&raquo;</a></span></p>
  41. </div>
  42. <?php endwhile; ?>
  43.  
  44. </div>
  45.  
  46. </div>
  47. <!-- END WRAPPER-FEATURED -->
  48. <?php endif; ?>
  49.  
  50. <!-- BEGIN HOMEPAGE BLOCKS -->
  51. <?php if(get_option('pyre_homepage_style') == 'magazine'): ?>
  52. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage')): ?>
  53. <div class="block full">
  54.  
  55. <h3><?php _e('Recent Posts', 'Avenue'); ?> <span class="arrows">&raquo;</span></h3>
  56.  
  57. <?php
  58. $recent_posts = new WP_Query(array(
  59. 'showposts' => 4,
  60. ));
  61. ?>
  62. <?php
  63. $big_count = round(4 / 4);
  64. if(!$big_count) { $big_count = 1; }
  65. ?>
  66. <?php $counter = 1; while($recent_posts->have_posts()): $recent_posts->the_post(); ?>
  67. <?php
  68. if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
  69. $icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
  70. } else {
  71. $icon = '';
  72. }
  73. ?>
  74. <?php if($counter <= $big_count): ?>
  75. <div class="block-item-big">
  76. <?php if(has_post_thumbnail()): ?>
  77. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image'); ?>
  78. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
  79. <?php else: ?>
  80. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=290&h=160" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
  81. <?php endif; ?>
  82. <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  83. <span class="block-meta"><?php the_time('F j, Y'); ?>, <?php comments_popup_link(); ?></span>
  84. </div>
  85. <?php else: ?>
  86. <div class="block-item-small">
  87. <?php if(has_post_thumbnail()): ?>
  88. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image-thumb'); ?>
  89. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='50' height='50' /></a><?php echo $icon; ?></div>
  90. <?php else: ?>
  91. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=60&h=60" alt="<?php the_title(); ?>" width='50' height='50' /></a><?php echo $icon; ?></div>
  92. <?php endif; ?>
  93. <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  94. <span class="block-meta"><?php the_time('F j, Y'); ?>, <?php comments_popup_link(); ?></span>
  95. </div>
  96. <?php endif; ?>
  97. <?php $counter++; endwhile; ?>
  98.  
  99. </div>
  100. <?php endif; ?>
  101. <?php endif; ?>
  102.  
  103. <?php if(get_option('pyre_homepage_style') == 'blog'): ?>
  104. <div class="block archive">
  105.  
  106. <h3>
  107. <?php _e('Recent Posts', 'Avenue'); ?>
  108. <span class="arrows">&raquo;</span>
  109. </h3>
  110.  
  111. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  112. <div id="post-<?php the_ID(); ?>" <?php post_class('block-item-big'); ?>>
  113. <?php
  114. if(has_post_format('video') || has_post_format('audio') || has_post_format('gallery')) {
  115. $icon = '<span class="' . get_post_format($post->ID) . '-icon"></span>';
  116. } else {
  117. $icon = '';
  118. }
  119. ?>
  120. <?php if(has_post_thumbnail()): ?>
  121. <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'widget-image'); ?>
  122. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
  123. <?php else: ?>
  124. <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=290&h=160" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
  125. <?php endif; ?>
  126. <h2><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h2>
  127. <span class="block-meta">
  128. <span class="heading-author"><?php the_author(); ?></span>
  129. <span class="heading-date"><?php the_time('F j, Y'); ?></span>
  130. <span class="heading-comments"><?php comments_popup_link('0','1','%'); ?></span>
  131. </span>
  132. <p><?php echo string_limit_words(get_the_excerpt(), 34); ?></p><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>' class="readmore"><?php _e('Read More', 'Avenue'); ?> <span class="block-arrows">&raquo;</span></a>
  133. </div>
  134. <?php endwhile; endif; ?>
  135.  
  136. <?php kriesi_pagination($pages = '', $range = 2); ?>
  137. </div>
  138.  
  139. <div class='block full' style='padding-top: 20px;'>
  140. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage (Blog Style)')): ?>
  141. <?php endif; ?>
  142. </div>
  143. <?php endif; ?>
  144. <!-- END HOMEPAGE BLOCKS -->
  145.  
  146. </div>
  147. <!-- END MAIN -->
  148.  
  149. <?php get_sidebar(); ?>
  150.  
  151. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement