WordPress.org

Ready to get started?Download WordPress

Forums

Three Rows and Three Columns? (6 posts)

  1. planesfillingwc
    Member
    Posted 3 years ago #

    Scripting isn't my strong suit, just trying to edit a theme to better fit my needs.

    So the issue is that I want my content to appear in only three rows and three columns. The plugin already has a preset for three columns, but I want to restrict it to only three rows as well. What do I need to modify?

    Here's the code:

    `<?php
    // Determine column/image size front page
    $cols = '3';
    $cols = get_option('woo_cols');
    $r1 = 3; $r2 = 2;
    if (get_option('woo_ratio1')) $r1 = get_option('woo_ratio1');
    if (get_option('woo_ratio2')) $r2 = get_option('woo_ratio2');
    if ( $cols == "1") {
    $class = "one"; $width = 940; $height = $width / $r1 * $r2;
    } elseif ( $cols == 2 ) {
    $class = "two"; $width = 460;
    } elseif ( $cols == 3 ) {
    $class = "three"; $width = 300;
    } elseif ( $cols == 4 ) {
    $class = "four"; $width = 220;
    } elseif ( $cols == 5 ) {
    $class = "five"; $width = 172;
    }
    $height = $width / $r1 * $r2;
    $height = round($height);
    ?>'

  2. Jonas Grumby
    Member
    Posted 3 years ago #

    I'm assuming you mean on your blog page.

    The easiest way it to edit the template for the page by giving the content div a different name (e.g. homecontent) and then in your CSS you can set #homecontent to float: left; overflow: hidden; height: whatever; width: whatever; etc.

    If you want your columns to have different widths, that's a little more tricky. OTTOMH I think the only way to do that would be to create a template that had the columns in it defined by the CSS and use multiple loops.

  3. planesfillingwc
    Member
    Posted 3 years ago #

    This is being pulled directly from the Main Index Template (index.php). Nothing seems to be defined in the Style Sheet, and I'd prefer not to Frankenstein this anymore than I already have due to my limited knowledge.

    Is there anything I can add to this script to get what I want?

    3 columns, 3 rows.

    Here's the theme: http://demo.woothemes.com/?name=object

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    have you tried to set this to 9 posts:

    'dashboard' 'settings' 'reading' 'Blog pages show at most [9] posts'

  5. Jonas Grumby
    Member
    Posted 3 years ago #

    It helps to know that it is a Woo theme because a lot of those themes have built-in configuration options and there may be an option to set your home page to "magazine style" which would give you columns although they would all be the same size. Otherwise you could create a new template called home.php, give each column a different DIV ID, define the width of each column in the CSS, and use multiple loops. I really don't know what your code does or does not do.

  6. planesfillingwc
    Member
    Posted 3 years ago #

    alchymyth was spot on. Thanks!

    /me-n00bing

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags