Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.14 KB | None | 0 0
  1. <?php global $up_options; ?>
  2. <?php get_header(); ?>
  3.  
  4. <div class="border-top">
  5.   <?php  the_breadcrumb(); ?>
  6. </div>
  7. <div id="wrapper" class="hfeed">
  8. <div id="main">
  9.   <div class="border-toppost"> </div>
  10.   <!-- .CONTENT -->
  11.   <div id="container-insidecp">
  12.     <div class="singlepost">
  13.       <div class="entry-content">
  14.         <?php  
  15.  
  16. // get the current category
  17.  
  18. $category = get_the_category();
  19.  
  20. // get the sticky posts in the category
  21.  
  22. query_posts(array( 'post__in' => get_option('sticky_posts'), 'orderby' => 'title', 'showposts' => '1' ,'post_date' => 'DESC' , 'cat' => ''.$category[0]->cat_ID.'' ));
  23.  
  24. ?>
  25.         <div class="cat-sticky">
  26.           <div class="clear"></div>
  27.         </div>
  28.         <div class="main-content">
  29.           <div class="title-frontmodule">
  30.             <div class="entry-title"> Свежие материалы в рубрике
  31.               "<?php
  32. $category = get_the_category();
  33. echo $category[0]->cat_name;
  34. ?>"
  35.           </div>
  36.           </div>
  37.           <?php query_posts($query_string . "&posts_per_page=4"); ?>
  38.           <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  39.           <div class="cat-box">
  40.             <div class="cat-thumb">
  41. <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
  42.           <?php
  43.   $thumb = get_post_thumbnail_id();
  44.   $img_url = wp_get_attachment_url( $thumb,'full' );
  45.   $image = aq_resize( $img_url, 110, 110, true ); ?>
  46.           <img src="<?php echo $image ?>" width="110" height="110" alt="<?php the_title(); ?>"/> </a>
  47.     </div>
  48.             <div class="cat-article">
  49.               <div class="title-front2"> <a href="<?php  the_permalink(); ?>" title="<?php  the_title(); ?>">
  50.                 <?php  the_title(); ?>
  51.                 </a> </div>
  52.               <div class="cat-time">
  53.                 <?php echo date_i18n(get_option('date_format'));?>
  54.               </div>
  55.               <div class="blog-article">
  56.                 <?php  echo limit_words(get_the_excerpt(), '12'); ?>
  57.               </div>
  58.               <div class="module7-rating">
  59.                 <?php  
  60.   if( get_post_meta(get_the_ID(), 'Rating') ){
  61.     $Rating= get_post_meta(get_the_ID(), 'Rating');
  62.     $Rating= explode("/", $Rating[0]);
  63.     $good = round($Rating[0]);
  64.     $total  = round($Rating[1]);    
  65.     if(!empty($good) && !empty($total) && ($good <= $total) && is_numeric($good) && is_numeric($total) ){
  66.       $i=0;
  67.       while($i < $good){
  68.         echo '<img src="' . get_template_directory_uri('template_directory') . '/images/star-gold.png" alt="<?php  the_title(); ?>"/>';
  69.         $i++;
  70.       }
  71.       $i = 0;
  72.       while($i < ($total - $good)){
  73.         echo '<img src="' . get_template_directory_uri('template_directory') . '/images/star-bw.png" alt="<?php  the_title(); ?>" />';
  74.         $i++;
  75.       }
  76.     } else{
  77.       echo "Invalid input for the Rating.";
  78.     }
  79.   };  ?>
  80.                 <div class="age-rating">
  81.                   <?php
  82.   $customField = get_post_custom_values("agerating");
  83. if (isset($customField[0])) {
  84.     echo "".$customField[0];
  85. }
  86. ?>
  87.                 </div>
  88.               </div>
  89.             </div>
  90.             <div class="clear"></div>
  91.           </div>
  92.           <?php endwhile; wp_reset_query(); endif; ?>
  93.         </div>
  94.         <!-- MAIN content -->
  95.         <div class="right-content">
  96.           <div class="title-frontmodule">
  97.             <div class="entry-title"> Остальные материалы рубрики
  98.               "<?php
  99. $category = get_the_category();
  100. echo $category[0]->cat_name;
  101. ?>"
  102.           </div>
  103.           </div>
  104.           <table class="table" cellpadding="2" cellspacing="2" border="0">
  105.             <th colspan="2"> </th>
  106.               <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  107.               query_posts('posts_per_page=3&paged=' . $paged);
  108.                 $i  = 0;
  109.                 $cols   = 2;
  110.                 echo '<tr>';
  111.                 if(have_posts()): while (have_posts()) : the_post();
  112.                         $i++;
  113.                         ?>
  114.               <td class="cat-title" valign="top"><div class="cat-titlepost">
  115.                   <div class="blog-title4"> <a href="<?php  the_permalink(); ?>" title="<?php  the_title(); ?>">
  116.                     <?php  the_title(); ?>
  117.                     </a> </div>
  118.                 </div>
  119.                 <div class="cat-time">
  120.                   <?php echo date_i18n(get_option('date_format'));?>
  121.                 </div></td>
  122.               <?php if ( ( $i % $cols ) == 0 ) {
  123.                                 echo '</tr>' . "\n";
  124.                                 echo '<tr>';
  125.                         }
  126.                 endwhile;
  127.  
  128.                 else:
  129.                     echo '<tr><td colspan="2"></td>';
  130.                 endif;
  131.                 echo '</tr>';
  132.                 wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'khabar' ), 'after' => '</div>' ) );
  133. ?>
  134.           </table>
  135.         </div>
  136.       </div>
  137.       <!-- .entry-content -->
  138.       <footer class="entry-meta">
  139.       </footer>
  140.     </div>
  141.   </div>
  142.   <!-- .SIDEBAR -->
  143.   <?php get_sidebar(); ?>
  144. </div>
  145. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement