-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-blog.php
62 lines (61 loc) · 3.22 KB
/
page-blog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php get_header(); ?>
<div class="headerline"></div>
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
query_posts( array( 'posts_per_page' => 15, 'post_status' => 'publish', 'paged' => $paged ) );
global $wp_query;
$pagecnt = $wp_query->max_num_pages;
$args1 = array( 'numberposts' => 1, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC');
$post1 = wp_get_recent_posts($args1);
$postId = $post1[0]['ID'];
$img_src = wp_get_attachment_image_src( get_post_thumbnail_id($postId) );
$img_src_url = $img_src[0];
$backimgsrc = get_the_post_thumbnail_url($postId,'large');
?>
<div class="grid-container spacer-top">
<div class="grid-100 tablet-grid-100">
<h1 class="blog-page-title"><?php
if ( is_day() ) { printf( __( 'Daily Archives: %s', 'catholicsingles' ), get_the_time( get_option( 'date_format' ) ) ); }
elseif ( is_month() ) { printf( __( 'Monthly Archives: %s', 'catholicsingles' ), get_the_time( 'F Y' ) ); }
elseif ( is_year() ) { printf( __( 'Yearly Archives: %s', 'catholicsingles' ), get_the_time( 'Y' ) ); }
else { _e( 'CatholicSingles.com Blog', 'catholicsingles' ); }
?></h1>
</div>
<?php echo wp_list_categories(); ?>
<div class="grid-100 tablet-grid-100">
<div class="latest-slide">
<div class="img_wrapper" style="background:url('<?php echo $backimgsrc;?>') no-repeat;background-size: cover;">
<div class='grid-40 tablet-grid-40 prefix-60' id="content">
<a href="<?php echo $post1[0]['guid']; ?>"><h4 class="cwhite post_title"><?php echo $post1[0]['post_title'];?></h4></a>
<span class="cwhite pull-left" style="margin-right: 5px;font-weight: 500;font-size: 18px;"><?php echo get_the_date('M j, Y', $postId);?></span>
<span class="cwhite pull-left" style="font-size: 18px;">By <?php $authorId = $post1[0]['post_author']; echo get_the_author_meta( 'display_name', $authorId ); ?></span><br/><br/>
<p class="cwhite" style="font-weight: 300"><?php echo get_the_excerpt($postId); ?></p>
</div>
</div>
</div>
</div>
<div id="posts_section">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post-preview grid-33">
<div class="">
<?php if (has_post_thumbnail()){ ?>
<div style="background-image:url(<?php the_post_thumbnail_url('large');?>)" class="blog_post_img_back">
</div>
<?php } ?>
<h1 class="entry-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<span class="bio-photo" style="margin-right:10px;font-weight: 500"><?php echo get_the_date('M j, Y'); ?> </span>
<span class="cblack">by <?php echo get_author_name(); ?></span>
<?php the_excerpt(); ?>
</div>
</div>
<?php endwhile; endif; ?>
<div class="clearfix"> </div>
<div class="aligncenter pagination_section">
<div class=""><?php previous_posts_link( 'Previous' ); ?></div>
<div class="page_number_section"><input type="text" class="blueborder" value="<?php echo $paged; ?>" /> <?php echo " of " .$pagecnt;?></div>
<div class=""><?php next_posts_link( 'Next' ); ?></div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>