Ready to get started?Download WordPress


Six posts per page, in two custom columns (5 posts)

  1. niski
    Posted 2 years ago #

    Hello. I'll be so grateful if anyone could tell me how to display posts in two different columns with one, common pagination. The link (picture) below describes precisely what I want to implement im my own theme.


    Thanks in advance ;)

    I'm using version 3.4.1

  2. the easiest way might to use the $wp_query->current_post variable in a conditional statement, to show the posts different;


    if( have_posts() ) : while( have_posts() ) : the_post();
    if( $wp_query->current_post <=2 ) { ?>
    output for each of the first three posts
    <?php } else { ?>
    output for each of the next three posts
    <?php } ?>
    else : echo 'no posts';

    what is the 'next/prev posts page' supposed to show?
    same layout or just the block layout for the 'next three posts'?

  3. niski
    Posted 2 years ago #

    The layout will remain without any changes after choosing another page. The first three posts wouldn't be the most recent but the latest among those next six news.

    I haven't got any experience with WP ;)

  4. The layout will remain without any changes after choosing another page.

    then the suggested code should work.

    what else do you need to know?

    what theme are you using as base for your customisations?

    some links:

  5. niski
    Posted 2 years ago #

    In some way, it seems working properly. In addition, would you be so kind and show me how to implement pagination into your above code? ;)

    I've forgotten. I don't know why but thumbnails don't work. I made everything correct. I wrote those two lines in functions.php

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 214, 214, true );

    Now, I have visible "Featured Image" in admin panel. I set a few images but they aren't shown in my theme. What may be a reason of that?

    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.

Topic Closed

This topic has been closed to new replies.

About this Topic