Advertisement
Guest User

single.php

a guest
Apr 14th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <div id="content" class="col-full">
  4. <div id="main" class="col-left">
  5.  
  6. <?php if ( function_exists( "yoast_breadcrumb" )) { yoast_breadcrumb('<div id="breadcrumb"><p>','</p></div>'); } ?>
  7.  
  8. <?php if (have_posts()) : $count = 0; ?>
  9. <?php while (have_posts()) : the_post(); $count++; ?>
  10.  
  11. <div class="post">
  12.  
  13. <h1 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
  14.  
  15. <p class="date">
  16. <span class="day"><?php the_time('j'); ?></span>
  17. <span class="month"><?php the_time('M'); ?></span>
  18. </p>
  19.  
  20. <div class="entry">
  21. <?php the_content(); ?>
  22. </div>
  23. <div id="vk_like"></div>
  24. <script type="text/javascript">
  25. VK.Widgets.Like("vk_like", {type: "full", height: 24});
  26. </script>
  27. <br /><br />
  28. <?php
  29. $original_post = $post;
  30. $tags = wp_get_post_tags($post->ID);
  31. if ($tags) {
  32. echo '<h4>Другие записи</h4>';
  33. $first_tag = $tags[0]->term_id;
  34. $args=array(
  35. 'tag__in' => array($first_tag),
  36. 'post__not_in' => array($post->ID),
  37. 'showposts'=>4,
  38. 'caller_get_posts'=>1
  39. );
  40. $my_query = new WP_Query($args);
  41. if( $my_query->have_posts() ) {
  42. echo "<ul>";
  43. while ($my_query->have_posts()) : $my_query->the_post(); ?>
  44. <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  45. <?php endwhile;
  46. echo "</ul>";
  47. }
  48. }
  49. $post = $original_post;
  50. wp_reset_query();
  51. ?>
  52. <div class="post-meta">
  53.  
  54. <ul>
  55.  
  56. <li class="categories">
  57. <span class="head"><?php _e('Категория', 'woothemes') ?></span>
  58. <span class="body"><?php the_category(', ') ?></span>
  59. </li>
  60. <li class="author">
  61. <span class="head"><?php _e('Автор', 'woothemes') ?></span>
  62. <span class="body"><?php the_author_posts_link(); ?></span>
  63. </li>
  64. </ul>
  65.  
  66. <div class="fix"></div>
  67.  
  68. </div><!-- /.post-meta -->
  69.  
  70. </div><!-- /.post -->
  71.  
  72. <div class="vkcom">
  73. <div id="vk_comments"></div>
  74. <script type="text/javascript">
  75. VK.Widgets.Comments("vk_comments", {limit: 20, width: "520", attach: "*"});
  76. </script>
  77.  
  78.  
  79. <?php endwhile; else: ?>
  80. <div class="post">
  81. <p><?php _e('Мы очень очень старались, но ничего не нашли.', 'woothemes') ?></p>
  82. </div><!-- /.post -->
  83. <?php endif; ?>
  84.  
  85. </div><!-- /#main -->
  86. </div>
  87.  
  88. <?php get_sidebar(); ?>
  89.  
  90. </div></div><!-- /#content -->
  91.  
  92. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement