Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php global $up_options; ?>
- <?php get_header(); ?>
- <div class="border-top">
- <?php the_breadcrumb(); ?>
- </div>
- <div id="wrapper" class="hfeed">
- <div id="main">
- <div class="border-toppost"> </div>
- <!-- .CONTENT -->
- <div id="container-insidecp">
- <div class="singlepost">
- <div class="entry-content">
- <?php
- // get the current category
- $category = get_the_category();
- // get the sticky posts in the category
- query_posts(array( 'post__in' => get_option('sticky_posts'), 'orderby' => 'title', 'showposts' => '1' ,'post_date' => 'DESC' , 'cat' => ''.$category[0]->cat_ID.'' ));
- ?>
- <div class="cat-sticky">
- <div class="clear"></div>
- </div>
- <div class="main-content">
- <div class="title-frontmodule">
- <div class="entry-title"> Свежие материалы в рубрике
- "<?php
- $category = get_the_category();
- echo $category[0]->cat_name;
- ?>"
- </div>
- </div>
- <?php query_posts($query_string . "&posts_per_page=4"); ?>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <div class="cat-box">
- <div class="cat-thumb">
- <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
- <?php
- $thumb = get_post_thumbnail_id();
- $img_url = wp_get_attachment_url( $thumb,'full' );
- $image = aq_resize( $img_url, 110, 110, true ); ?>
- <img src="<?php echo $image ?>" width="110" height="110" alt="<?php the_title(); ?>"/> </a>
- </div>
- <div class="cat-article">
- <div class="title-front2"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
- <?php the_title(); ?>
- </a> </div>
- <div class="cat-time">
- <?php echo date_i18n(get_option('date_format'));?>
- </div>
- <div class="blog-article">
- <?php echo limit_words(get_the_excerpt(), '12'); ?>
- </div>
- <div class="module7-rating">
- <?php
- if( get_post_meta(get_the_ID(), 'Rating') ){
- $Rating= get_post_meta(get_the_ID(), 'Rating');
- $Rating= explode("/", $Rating[0]);
- $good = round($Rating[0]);
- $total = round($Rating[1]);
- if(!empty($good) && !empty($total) && ($good <= $total) && is_numeric($good) && is_numeric($total) ){
- $i=0;
- while($i < $good){
- echo '<img src="' . get_template_directory_uri('template_directory') . '/images/star-gold.png" alt="<?php the_title(); ?>"/>';
- $i++;
- }
- $i = 0;
- while($i < ($total - $good)){
- echo '<img src="' . get_template_directory_uri('template_directory') . '/images/star-bw.png" alt="<?php the_title(); ?>" />';
- $i++;
- }
- } else{
- echo "Invalid input for the Rating.";
- }
- }; ?>
- <div class="age-rating">
- <?php
- $customField = get_post_custom_values("agerating");
- if (isset($customField[0])) {
- echo "".$customField[0];
- }
- ?>
- </div>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- <?php endwhile; wp_reset_query(); endif; ?>
- </div>
- <!-- MAIN content -->
- <div class="right-content">
- <div class="title-frontmodule">
- <div class="entry-title"> Остальные материалы рубрики
- "<?php
- $category = get_the_category();
- echo $category[0]->cat_name;
- ?>"
- </div>
- </div>
- <table class="table" cellpadding="2" cellspacing="2" border="0">
- <th colspan="2"> </th>
- <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- query_posts('posts_per_page=3&paged=' . $paged);
- $i = 0;
- $cols = 2;
- echo '<tr>';
- if(have_posts()): while (have_posts()) : the_post();
- $i++;
- ?>
- <td class="cat-title" valign="top"><div class="cat-titlepost">
- <div class="blog-title4"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
- <?php the_title(); ?>
- </a> </div>
- </div>
- <div class="cat-time">
- <?php echo date_i18n(get_option('date_format'));?>
- </div></td>
- <?php if ( ( $i % $cols ) == 0 ) {
- echo '</tr>' . "\n";
- echo '<tr>';
- }
- endwhile;
- else:
- echo '<tr><td colspan="2"></td>';
- endif;
- echo '</tr>';
- wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'khabar' ), 'after' => '</div>' ) );
- ?>
- </table>
- </div>
- </div>
- <!-- .entry-content -->
- <footer class="entry-meta">
- </footer>
- </div>
- </div>
- <!-- .SIDEBAR -->
- <?php get_sidebar(); ?>
- </div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement