Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14611 reviews 1734 hosting providers

Questions & Answers

How to put recent posts to H1 in my WordPress blob

Dec 7, 2012 by Maria
Hi all
I have a WordPress blog and I want to be able to put the newer posts in the H1 and the older posts below it. How do I change the loop behavior to work this way?

Thanks in advanced

2 Answers

0 votes
Dec 7, 2012 by WebGuru
Try using offset in your loop to call older posts.
something like
$args = array( 'postsnumbuer' => 5, 'offset' => 5 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
check this
0 votes
Dec 7, 2012 by expert
<<?php echo $tag; ?>><?php title(); ?></<?php echo $tag; ?>>
This will replace the existing:
<h1><?php title(); ?></h1>