• I’m playing around with Threattocreativity v2.3 and I’m wondering if I can make it so that the first/most recent post takes up a whole row.

    What would be even cooler than that is if I could make it so that the first post takes up a whole row, the next two older posts make up a 2 column row and the rest of the posts follow the normal 3 column style. Like this…

    [1........]
    [2..] [3..]
    [4] [5] [6]
    [7] [8] [9]

    If anyone has ideas on how to make that work, please post them here.
    Thanks!
    –sam

Viewing 6 replies - 1 through 6 (of 6 total)
  • the idea:
    use conditional tags to restrict this to the front page;
    use counter to add extra css classes to the .post class, for the first three posts.

    index.php:

    <div onclick="location.href='<?php the_permalink() ?>';" style="cursor:pointer;background:#<?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?>;" class="post bg thickbox <?php if( !is_paged() && !is_archive() ) { $count++; if( $count == 1 ) { $extra_class = 'fullwit'; } elseif( $count == 2 || $count == 3 ) { $extra_class = 'halfwit'; } else { $extra_class = '';  } }; echo $extra_class; ?>" id="thickbox post-<?php the_ID(); ?>">

    style.css

    .post.fullwit { width: 660px; }
    .post.halfwit { width: 315px; }

    Thread Starter Chocolalato

    (@lalato)

    Thanks, alchmyth. I’ll give that a try.

    Thread Starter Chocolalato

    (@lalato)

    That worked perfectly, alchmyth. Thanks!

    Thread Starter Chocolalato

    (@lalato)

    Just wondering, how would that work if using post_class instead of class? Thanks!

    using post_class() – replace this section:

    class="post bg thickbox <?php if( !is_paged() && !is_archive() ) { $count++; if( $count == 1 ) { $extra_class = 'fullwit'; } elseif( $count == 2 || $count == 3 ) { $extra_class = 'halfwit'; } else { $extra_class = ''; } }; echo $extra_class; ?>"

    for instance with something like:

    <?php $count++; $extra = (!is_paged()&&!is_archive())?($count<=1?'fullwit':($count<=3?'halfwit':'')):''; $post_class(array('post','bg','thickbox',$extra)); ?>

    (untested)

    https://codex.www.ads-software.com/Function_Reference/post_class#Adding_More_Classes

    Thread Starter Chocolalato

    (@lalato)

    Thanks, alchmyth. I’ll play around with it. You’ve been very helpful, and I greatly appreciate it. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Make the most recent post take up a whole row?’ is closed to new replies.