How to make a 2-column archive page

Community Forums Forums Design Tips and Tricks How to make a 2-column archive page

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  Hard Boiled Greg 1 year, 12 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5829

    DigitalC
    Participant
    Post count: 20

    Hi, I’m using the news theme, and on my archive page there are 2 columns – one column has authors, categories, etc and the other column has recent posts. What I’d like to do is keep the 2 columns but use them BOTH for posts – say, 20 posts on the left and the next 20 on the right. I don’t know enough php to do that so would anyone be able to tell me how I can get my archive page to “get posts” then essentially “get more posts”? So I end up with say, the 40 most recent posts split in 2 columns. Thank you!

    #7052

    Hard Boiled Greg
    Participant
    Post count: 88

    Hi,

    Are you able to post a link to your site?

    HBG


    Website: Hard Boiled Greg Twitter: @hbgreg

    #7069

    DigitalC
    Participant
    Post count: 20

    This is my archive page.

    http://www.websearchsocial.com/archives

    I’d like to have all recent articles – 25 and 25. Thanks!

    #7079

    Hard Boiled Greg
    Participant
    Post count: 88

    Thanks for the link DigitalC!  Wrapping a few presents right now; I’ll be back a bit later with some suggestions for you.

    HBG


    Website: Hard Boiled Greg Twitter: @hbgreg

    #7086

    Hard Boiled Greg
    Participant
    Post count: 88

    OK, the Archive template is using the “wp_get_archives” function which apparently doesn’t have an offset, so we’ll have to “get_posts” instead.

    We don’t want to edit the parent theme files so copy the “page_archive.php” file from your genesis folder and paste it into your child theme.  Then replace this section in that file (lets try a pastie) :

    <div class=”archive-page”>

    <h4></h4>
    <ul>

    </ul>

    <h4></h4>
    <ul>

    </ul>

    </div><!– end .archive-page–>

    <div class=”archive-page”>

    <h4></h4>
    <ul>

    </ul>

    <h4></h4>
    <ul>

    </ul>

    <h4></h4>
    <ul>

    </ul>

    </div><!– end .archive-page–>

    With this:

    <div class=”archive-page”>

    <h4></h4>
    <ul>
    <!–?php global $post; $args = array( ‘numberposts’ => 25 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>
    <li><a href=”“></a></li>

    </ul>

    </div><!– end .archive-page–>

    <div class=”archive-page”>

    <h4></h4>
    <ul>
    <!–?php global $post; $args = array( ‘numberposts’ => 25, ‘offset’=> 25 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>
    <li><a href=”“></a></li>

    </ul>
    </div><!– end .archive-page–>

    Let me know how it works out for you.

    HBG


    Website: Hard Boiled Greg Twitter: @hbgreg

    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg. Reason: pastie didn't work
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg. Reason: Good grief we need a better way to paste code
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg. Reason: pastie didn't work
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg. Reason: Good grief we need a better way to paste code
    • This reply was modified 1 year, 12 months ago by  Hard Boiled Greg.
    #7092

    Hard Boiled Greg
    Participant
    Post count: 88

    –Extra Post– please delete


    Website: Hard Boiled Greg Twitter: @hbgreg

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.