Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Home Page
- * The events page template.
- *
- *
- * @package WordPress
- * @subpackage
- * @since
- */
- get_header(); ?>
- <div id="page-content">
- <div class="container">
- <div class="content">
- <?php get_template_part( 'loop', 'home-carousel' ); ?>
- <?php
- /**
- * Loop for home page.
- *
- * @package WordPress
- * @subpackage themeName
- * @since themeName 1.0
- */
- ?>
- <div class="more-about">
- <h2>TODAY'S NEWS:</h2>
- <h3><?php echo date('l jS F Y'); ?></h3>
- <div class="posts">
- <?php
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args = array(
- 'posts_per_page' => 3,
- 'post_status' => 'publish',
- 'ignore_sticky_posts' => 1,
- 'paged'=>$paged
- );
- query_posts( $args );
- ?>
- <?php if(have_posts()) : ?>
- <?php while ( have_posts() ) : the_post() ?>
- <div class="post">
- <div class="main-img">
- <?php
- if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
- the_post_thumbnail('standard-posts');
- }
- ?>
- </div>
- <!-- main-img -->
- <div class="content">
- <p class="date">
- <?php if(!function_exists('how_long_ago')){the_time('D'); } else { echo how_long_ago(get_the_time('U')); } ?>
- @ <?php the_date('h.i A'); ?>
- </p>
- <!-- date -->
- <div class="social">
- <a href="#" class="twitter-icon-small">Twitter</a>
- <a href="#" class="facebook-icon-small">Facebook</a>
- </div>
- <!-- social -->
- <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
- <?php the_excerpt(); ?>
- <div class="related">
- <h5>RELATED STORIES:</h5>
- <div class="stories">
- <?php
- $postsId = explode(",", get_post_meta(get_the_ID(), 'tmc_related_posts', true));
- $args = array(
- 'post_type' => 'post',
- 'post_status' => "published",
- 'posts_per_page' => 3,
- 'post__in' => $postsId
- );
- $related = new WP_Query($args);
- ?>
- <?php if($related->have_posts()) : ?>
- <?php while($related->have_posts()) : $related->the_post() ?>
- <p class="story">
- <span class="date"> <?php the_time('j M Y') ?></span>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- </p>
- <?php endwhile; ?>
- <?php endif; ?>
- </div>
- <!-- sotries -->
- </div>
- <!-- related -->
- </div>
- <!-- content -->
- </div>
- <!-- post -->
- <?php endwhile; ?>
- <?php if(function_exists('wp_paginate')) {
- wp_paginate();
- } ?>
- <?php endif; ?>
- <?php wp_reset_query(); ?>
- </div>
- <!-- posts -->
- </div>
- <!-- more-about -->
- <?php get_template_part( 'loop', 'today-stories' ); ?>
- </div>
- <!-- content -->
- </div>
- <!-- container -->
- </div>
- <!-- PAGE-CONTENT -->
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment