WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: Twentyten] + two column (like Magazine) (3 posts)

  1. Rosa Tyczynski
    Member
    Posted 7 months ago #

    I would like to slightly redo the theme TwentyTen. I would like to display the first two posts in two columns (as is the theme magazine). Now I did it statically in index.php pasted data - example: http://happybank.pl/
    I would like to do this automatically.

    Perhaps i need to do it in loop.

    <table><tr><td width="50%">

    TITLE post1
    excerpt post1

    </td>
    <td width="50%">

    TITLE post2
    excerpt post2

    </td></tr></table>

    I thought in the following way, but I do not know how to determine the post1 and post2, and the rest of the posts should be displayed normally below one by one

  2. esmi
    Forum Moderator
    Posted 7 months ago #

    Do not edit the Twenty Ten theme itself. First create a child theme for your changes.

  3. CrouchingBruin
    Member
    Posted 7 months ago #

    You don't have to make a change in index.php, you can do it with CSS.

    As esmi noted, don't modify the theme files directly, but use a child theme, or use a CSS plugin since TwentyTen doesn't support custom CSS.

    Then add this CSS to either the end of your child theme's style.css file, or to your CSS plugin's Custom CSS option:

    #content > .post:nth-child(1),
    #content > .post:nth-child(2) {
    	width: 45%;
    	display: inline-block;
    
    }
    #content > .post:nth-child(2) {
    	margin-left:	9%;
    }

    What this will do is set the widths of your first two posts to 45% of their container's width, then set a margin between them.

Reply

You must log in to post.

About this Topic

Tags