Viewing 14 replies - 1 through 14 (of 14 total)
  • Unless you’re a dab hand at theme editing, PHP, XHTML and CSS, I’d suggest you try and find a theme that does this kind of layout already. Try looking for themes that include a featured posts option.

    Looks like 2 rows of 2, does it change depending on screen res?

    It’s not too hard, simple count the posts job… use floats, clear the floats when a count is reached, give the floated elements fixed width, and you esentially have what look like rows of posts in blocks… (it’ll work better inside a fixed width design).

    Tables are still an option, but obviously frowned upon.. lol..

    You can do this quite a few ways… depending on how you want the posts ordered…

    [post-1][post-2]
    [post-3][post-4]

    or

    [post-1][post-3]
    [post-2][post-4]

    I don’t mind writing up an example if it’s desired…

    Of course that puts aside the CSS styling you’ll need to do yourself.. ??

    Thread Starter cpkid2

    (@cpkid2)

    t31os_, if you can write up an example, it would help me tremendously. ??

    I’m familiar with xhtml and css but am still a newbie when it comes to php.

    I wasn’t about much yesterday else i’d have replied sooner, just working up an example that you can play with then i’ll post a pastebin link up for you.

    I hadn’t forgotten… ??

    https://wordpress.pastebin.com/f1d9e0253

    You’ll need to modify areas to suit.. (CSS width, height stuff)

    $myparamters

    can just be set to..

    $myparameters = '';

    ..if you want to just grab posts from all categories.. (put category in as an example)

    In any case, you can have it do however many rows, posts per rows you want, and the paging will work, along with a message that displays how many other posts exist (only shows on the first page). I got a little carried away, but it can be hacked away at if you don’t want certain bits..

    It is still somewhat of a basic example, but it should help nonetheless… ??

    Thread Starter cpkid2

    (@cpkid2)

    thank you t31os! when i get back home i will attempt to dissect the code you posted. i really appreciate you taking the time to help me out!!

    If you have any issues, just post back..

    ??

    Thread Starter cpkid2

    (@cpkid2)

    @t31os_

    I’ve added the CSS needed (.post-item { float:left;width:200px;height:200px;overflow:hidden }) to style.css, named the file (code you gave me) index.php and replaced this index.php with the index.php in the default Kubrick theme and the only elements that are showing up is the header, sidebar, and footer.

    I looked through your code again and again but couldn’t find a reason why nothing at all would show up. Perhaps there is something I missed? If you can give me a little hand I’d appreciate it!

    Did you change this line.

    $myparameters = '&category_name=Blog';

    You should get at least something on the page unless there’s no posts matched to the query, in the example the “no results” area is commented out, left for you to do with as you choose.

    Thread Starter cpkid2

    (@cpkid2)

    Ah, yes that was it! Thanks!

    Thread Starter cpkid2

    (@cpkid2)

    hey guys,
    i dont know if any of you will be around to read this, basically what i need is something similar to this.

    here is the link:
    https://zc.fezj.net/

    i need there to be 4 rows and 2 posts (post-image in this case) per row.
    here is what im currently using for the loop

    <?php if (have_posts()) : ?>
    
      <?php while (have_posts()) : the_post(); ?>
    
      <?php
      $image = get_post_meta($post->ID, 'post-image', true);
      $imageZoom = get_post_meta($post->ID, 'zoom-image', true);
      ?>
    
      <?php if ($image != "") { ?>
    
      <div class="post" id="post-<?php the_ID(); ?>">
    
                <!-- Display Each Image Block -->
                            <div class="zoom"></div>
    
                            <a href="<?php echo $imageZoom; ?>" class="lightbox">
                                        <img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" class="post-image"/>
                            </a>
    
                <?php }; ?>
    
      </div>
    
      <!--/post -->
    
    		<?php endwhile; ?>
    
      <div class="navigation">
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
      </div>
    
      <?php else : ?>
    
      <div id="sidebar-left-content">
      <br />
      <h2>Not Found</h2>
      <p>Unfortunately I can't find what your looking for. <br /> Try heading back to the homepage and refinding your way. <br /> If you were brought here from another page it may be appropriate to contact the Administrator..</p>
      </div>
      <?php endif; ?>

    You need more posts to test but you can start with some CSS…

    .post {
    	width:280px;
    	float:left;
    	margin:0;
    }
    .post a.lightbox {
    	float:none;
    	padding:0;
    	margin:0;
    	display:block;
    }
    .post-image {
    	margin:35px 0 0 10px;
    	padding:0;
    }

    All you need after that is a post counter and a little addition to your above code to clear the floats…

    Add the CSS and make a couple more posts.. ??

    Is there a way to make more than one category (all of them) show up like this?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘How would I go about arranging the front page blog posts in 2 rows of 3?’ is closed to new replies.