0

I want to create a template where the first (latest) post is shown full width respectively without a sidebar. All the following posts should have been displayed normally, like here

1st POST

2nd POST | SIDEBAR
3rd POST | SIDEBAR
4th POST | SIDEBAR
...

Can you tell me how to do this?

1

You can also doe like below code snippet:

$flag=0;
$args = array(
'orderby' => 'title',
'order'   => 'DESC',); 
$query = new WP_Query( $args );
while ( $query->have_posts() ) {
{
  the_post();
  if($flag==0)
  {
     // you first post's title, content etc
     $flag=1;
  }
  else
  {
      //rest of your post's title, sidebar, etc
  }
}
0

You have to create some counter, that will count all your posts in your query.

Than, wrap the first post with full width div. For example:

Title and content Content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.