Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Description: Index, Main Page
- */
- ?>
- <?php get_header(); ?>
- <div id="main-block">
- <div id="content">
- <?php if (have_posts()) : ?>
- <ul>
- <?php while (have_posts()) : the_post(); ?>
- <li <?php post_class(); ?> id="post-<?php the_ID(); ?>">
- <?php if(!is_sticky()) : ?>
- <div class="box3">
- <?php else : ?>
- <div class="box4">
- <?php endif ; ?>
- <div class="tail-right">
- <div class="tail-left">
- <div class="tail-top">
- <div class="corner-bottom-right">
- <div class="corner-bottom-left">
- <div class="corner-top-right">
- <div class="corner-top-left">
- <div class="box-indent">
- <div class="title">
- <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
- </div>
- <div class="postdata">
- <span class="category"><?php the_category(', ') ?></span>
- <span class="date"><?php the_time('d.m.Y') ?></span>
- <span class="comments">
- <?php if ( post_password_required() ) : ?>
- <?php echo __('Enter password', 'red-shadow'); ?>
- <?php else : ?>
- <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
- <?php endif ; ?>
- </span>
- </div><!--.postdata-->
- <?php
- $rs_content = $post->post_content;
- $rs_search_images = '~<img [^>]* />~';
- /*Run preg_match_all to grab all the images and save the results in $pics*/
- preg_match_all( $rs_search_images, $rs_content, $rs_pics );
- // Check to see if we have at least 1 image
- $rs_no_of_pics = count($rs_pics[0]);
- ?>
- <div class="entry">
- <?php //Check if post has no images attached, and if not, display the thumbnail, otherwise don't display the thumbnail ?>
- <?php if ($rs_no_of_pics == 0) : ?>
- <?php if (has_post_thumbnail()) the_post_thumbnail(array(300,200), array('class' => 'float-left thumb-img')) ?>
- <?php endif; ?>
- <?php the_content('Read more ...'); ?>
- </div>
- <div class="clear-both"></div>
- <div class="more-pages">
- <?php wp_link_pages('before=<p style="margin-top:0.5em">&after=</p>&next_or_number=number&pagelink=Page no %'); ?>
- </div>
- <div class="more-pages">
- <?php
- $rs_this_page = get_post($id);
- $rs_parent_id = $rs_this_page->post_parent;
- if ($rs_parent_id) {
- $rs_parent = get_page($rs_parent_id);
- echo '<a style="margin-top:0.5em" href="'.get_permalink($rs_parent->ID).'" title="">'.get_the_title($rs_parent->ID).'</a>';
- }
- ?>
- <?php
- $rs_children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
- if ($rs_children) {
- ?>
- <ul>
- <?php echo $rs_children; ?>
- </ul>
- <?php } ?>
- </div>
- <div class="post-tags">
- <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </li>
- <?php endwhile; ?>
- </ul>
- <?php if ($wp_query->max_num_pages > 1) : ?>
- <div class="nav-entries">
- <div class="tail-right">
- <div class="tail-left">
- <div class="tail-top">
- <div class="corner-bottom-right">
- <div class="corner-bottom-left">
- <div class="corner-top-right">
- <div class="corner-top-left">
- <div class="box-indent">
- <span class="prev"><?php next_posts_link('<span>« Previous Entries</span>') ?></span>
- <span class="next"><?php previous_posts_link('<span>Next Entries »</span>') ?></span>
- <div class="clear-both"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php endif ; ?>
- <?php else : ?>
- <div class="box3">
- <div class="tail-right">
- <div class="tail-left">
- <div class="tail-top">
- <div class="corner-bottom-right">
- <div class="corner-bottom-left">
- <div class="corner-top-right">
- <div class="corner-top-left">
- <div class="box-indent">
- <div class="title">
- <h2 class="text-center">Word(s) not found in any sentence.</h2>
- <p id="not-found" class="text-center">Sorry, but you are looking for something that isn't here.</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- </div><!--#content-->
- </div><!--#main-block-->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment