Forums

[resolved] Two Column Post Index File (6 posts)

  1. caflma
    Member
    Posted 2 years ago #

    I want to create two columns for the frontpage (index file). It would be similar to a magazine style.

    In other words, I want to have two posts right next to each other.

    Could someone please help me with the code?

  2. MAzCastro
    Member
    Posted 2 years ago #

    There are many ways to achieve that.

    this simple CSS aproach whould work:

    Add this logic to your markup:

    ´<div id="postContainer">
    <div class="myPost"> your post #1 here </div>
    <div class="myPost"> your post #2 here </div>
    <div class="myPost"> your post #3 here </div>
    <div class="myPost"> your post #4 here </div>
    </div>´

    Then add this to your CSS:

    ´#postContainer {
    width:600px;
    }
    .myPost {
    width:290px;
    float:left;
    margin: 0 5px;

    MAC :)

  3. caflma
    Member
    Posted 2 years ago #

    Thanks for your reply. But how can I add the Posts titles automatically?

    I call my post tile with:

    <h1>" rel="bookmark"><?php the_title(); ?></h1>

    If I put --> <

    div class="myPost"><h1>" rel="bookmark"><?php the_title(); ?></h1></div>

    It works for this part, but I want the next posts automatically added to the site. Do you know the correct code to achieve this?

  4. caflma
    Member
    Posted 2 years ago #

    I figured it out, thanks!!!

  5. MAzCastro
    Member
    Posted 2 years ago #

    cool :)

  6. wareno
    Member
    Posted 2 years ago #

    caflma
    i loved your idea but i couldn't make it auto as you wanted .
    tried more than twice so i figured out im not and i won't be a programmer
    newbie at websitemaster and wordpress .

    so i hope you can share how did you solve your problems
    if you didn't pay anything for it :)

    thanx in advance

Topic Closed

This topic has been closed to new replies.

About this Topic