Advertisement
Guest User

Untitled

a guest
Apr 24th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Boutique
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.  
  9. <?php the_post(); ?>
  10.  
  11. <div style="width: 960px; float: left;">
  12.  
  13. <div id="sidebar-right" class="sidebar" style="float: right;">
  14. <div class="block">
  15. <div class="block-border">
  16. <div class="block-content">
  17. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Right Top') ) : ?>
  18. <?php endif; ?>
  19. </div> <!-- end .block-content -->
  20. </div> <!-- end .block-border -->
  21. </div> <!-- end .block -->
  22.  
  23. <div class="block">
  24. <div class="block-border">
  25. <div class="block-content">
  26. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Right Bottom') ) : ?>
  27. <?php endif; ?>
  28. </div> <!-- end .block-content -->
  29. </div> <!-- end .block-border -->
  30. </div> <!-- end .block -->
  31. </div> <!-- end #sidebar-right -->
  32.  
  33. <div id="entries" style="float: left;">
  34.  
  35. <?php the_content(); ?>
  36.  
  37. <?php
  38.  
  39. $posts = get_posts("category_name=boutique&numberposts=-1");
  40.  
  41. if ( count($posts) ) {
  42. $artIndex = -1;
  43. $perPage = 10;
  44. $pageNumber = 1;
  45. $last_page_displayed = 1;
  46. foreach($posts as $post) {
  47. $artIndex++;
  48. setup_postdata($post);
  49. $pageNumber = floor($artIndex/$perPage)+1;
  50. $pot_pageNumber = floor(($artIndex+1)/$perPage)+1;
  51. if($pot_pageNumber > $last_page_displayed){
  52. $last_page_displayed = $pageNumber;
  53. $is_last = "";
  54. }else{
  55. $is_last = "";
  56. }
  57. ?>
  58.  
  59.  
  60.  
  61. <div class="entry post entry-full <?php echo $is_last;?>" rel="<?php echo $pageNumber?>" <?php if($pageNumber != 1){echo "style='display:none;'";} ?>>
  62. <div class="border">
  63. <div class="bottom">
  64. <div class="entry-content clearfix">
  65. <div class="thumbnail">
  66. <a href="<?php the_permalink() ?>"><?php echo get_the_post_thumbnail($post->ID, 'medium');?></a>
  67. </div>
  68.  
  69. <h3><a href="<?php the_permalink(); ?>"><?php truncate_title(40); ?></a></h3><br />
  70. <!--<p class="date"><?php the_time(get_option('magnificent_date_format')) ?></p><br />-->
  71. <?php the_excerpt(); ?>
  72. <a class="readmore" href="<?php the_permalink() ?>"><span>detalii</span></a>
  73. </div>
  74.  
  75. </div> <!-- end .bottom -->
  76. </div> <!-- end .border -->
  77. </div> <!-- end .entry -->
  78.  
  79. <?php
  80. }
  81. }
  82. ?>
  83.  
  84. <input type="hidden" name="number_of_pages" value="<?php echo $pageNumber?>" />
  85. <div class="pagination">
  86. <div class="pageNumbers">
  87. <ul id="navigation">
  88. <?php
  89. for($i = 1; $i <= $pageNumber; $i++){
  90. ?>
  91. <li><a href="#!page=<?php echo $i;?>" rel="<?php echo $i;?>"><?php echo $i; ?></a></li>
  92. <?php } ?>
  93. </ul>
  94. </div>
  95. </div>
  96.  
  97. <div class="clear"></div>
  98.  
  99. <!-- <?php if (get_option('magnificent_integration_single_bottom') <> '' && get_option('magnificent_integrate_singlebottom_enable') == 'on') echo(get_option('magnificent_integration_single_bottom')); ?>-->
  100.  
  101. </div>
  102.  
  103. </div>
  104.  
  105. <script language="javascript">
  106.  
  107. jQuery(document).ready(function(){
  108.  
  109. var loc = window.location.href;
  110. var page_number = 1;
  111. var loc_arr = loc.split("#!");
  112. if(loc_arr.length > 1){
  113. page_number = parseInt(loc_arr[1].replace("page=",""));
  114. }
  115. jQuery(".entry").hide();
  116. jQuery(".entry[rel="+page_number+"]").show();
  117. jQuery("#navigation").find("a").removeClass("active_page");
  118. jQuery("#navigation").find("a[rel="+page_number+"]").addClass("active_page");
  119. jQuery("#navigation").find("a").unbind("click").bind("click", function(event){
  120. jQuery(".entry").hide();
  121. jQuery(".entry[rel="+jQuery(this).attr("rel")+"]").show();
  122. jQuery("#navigation").find("a").removeClass("active_page");
  123. jQuery("#navigation").find("a[rel="+jQuery(this).attr("rel")+"]").addClass("active_page");
  124.  
  125. });
  126. });
  127. </script>
  128.  
  129. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement