Guest User

Untitled

a guest
Jan 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. <?php
  2. /*
  3. Description: Index, Main Page
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7. <div id="main-block">
  8. <div id="content">
  9. <?php if (have_posts()) : ?>
  10. <ul>
  11. <?php while (have_posts()) : the_post(); ?>
  12. <li <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  13. <?php if(!is_sticky()) : ?>
  14. <div class="box3">
  15. <?php else : ?>
  16. <div class="box4">
  17. <?php endif ; ?>
  18. <div class="tail-right">
  19. <div class="tail-left">
  20. <div class="tail-top">
  21. <div class="corner-bottom-right">
  22. <div class="corner-bottom-left">
  23. <div class="corner-top-right">
  24. <div class="corner-top-left">
  25. <div class="box-indent">
  26. <div class="title">
  27. <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
  28. </div>
  29. <div class="postdata">
  30. <span class="category"><?php the_category(', ') ?></span>
  31. <span class="date"><?php the_time('d.m.Y') ?></span>
  32. <span class="comments">
  33. <?php if ( post_password_required() ) : ?>
  34. <?php echo __('Enter password', 'red-shadow'); ?>
  35. <?php else : ?>
  36. <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
  37. <?php endif ; ?>
  38. </span>
  39. </div><!--.postdata-->
  40. <?php
  41. $rs_content = $post->post_content;
  42. $rs_search_images = '~<img [^>]* />~';
  43. /*Run preg_match_all to grab all the images and save the results in $pics*/
  44. preg_match_all( $rs_search_images, $rs_content, $rs_pics );
  45. // Check to see if we have at least 1 image
  46. $rs_no_of_pics = count($rs_pics[0]);
  47. ?>
  48. <div class="entry">
  49. <?php //Check if post has no images attached, and if not, display the thumbnail, otherwise don't display the thumbnail ?>
  50. <?php if ($rs_no_of_pics == 0) : ?>
  51. <?php if (has_post_thumbnail()) the_post_thumbnail(array(300,200), array('class' => 'float-left thumb-img')) ?>
  52. <?php endif; ?>
  53. <?php the_content('Read&nbsp;more ...'); ?>
  54. </div>
  55. <div class="clear-both"></div>
  56. <div class="more-pages">
  57. <?php wp_link_pages('before=<p style="margin-top:0.5em">&after=</p>&next_or_number=number&pagelink=Page no %'); ?>
  58. </div>
  59. <div class="more-pages">
  60. <?php
  61. $rs_this_page = get_post($id);
  62. $rs_parent_id = $rs_this_page->post_parent;
  63. if ($rs_parent_id) {
  64. $rs_parent = get_page($rs_parent_id);
  65. echo '<a style="margin-top:0.5em" href="'.get_permalink($rs_parent->ID).'" title="">'.get_the_title($rs_parent->ID).'</a>';
  66. }
  67. ?>
  68. <?php
  69. $rs_children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
  70. if ($rs_children) {
  71. ?>
  72. <ul>
  73. <?php echo $rs_children; ?>
  74. </ul>
  75. <?php } ?>
  76. </div>
  77. <div class="post-tags">
  78. <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </li>
  90. <?php endwhile; ?>
  91. </ul>
  92. <?php if ($wp_query->max_num_pages > 1) : ?>
  93. <div class="nav-entries">
  94. <div class="tail-right">
  95. <div class="tail-left">
  96. <div class="tail-top">
  97. <div class="corner-bottom-right">
  98. <div class="corner-bottom-left">
  99. <div class="corner-top-right">
  100. <div class="corner-top-left">
  101. <div class="box-indent">
  102. <span class="prev"><?php next_posts_link('<span>&laquo; Previous Entries</span>') ?></span>
  103. <span class="next"><?php previous_posts_link('<span>Next Entries &raquo;</span>') ?></span>
  104. <div class="clear-both"></div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <?php endif ; ?>
  115. <?php else : ?>
  116. <div class="box3">
  117. <div class="tail-right">
  118. <div class="tail-left">
  119. <div class="tail-top">
  120. <div class="corner-bottom-right">
  121. <div class="corner-bottom-left">
  122. <div class="corner-top-right">
  123. <div class="corner-top-left">
  124. <div class="box-indent">
  125. <div class="title">
  126. <h2 class="text-center">Word(s) not found in any sentence.</h2>
  127. <p id="not-found" class="text-center">Sorry, but you are looking for something that isn't here.</p>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <?php endif; ?>
  139. </div><!--#content-->
  140. </div><!--#main-block-->
  141. <?php get_sidebar(); ?>
  142. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment