• I need to separate my posts to where they are not all one block. I would like to add space between them in order to change my wrap background to grey and keep the posts white. Right now, the PHP only calls the ‘post_area,’ and edits to the #postblock do nothing.

    Any way to change this? I’ll probably have to edit the PHP to retrieve the posts individually not just the area. Any help is appreciated.

    PS: Working with Organic Theme Premium White @ https://www.jordacity.com/journal

    Here’s the CSS:

    #postblock {
    	float: left;
    	width: 100%;
    	border-bottom: 1px solid #dddddd;
    	padding: 0px 0px 5px 0px;
    	margin: 0px 0px 5px 0px;
    	}
    
    .postarea {
    	padding: 5px 0px 5px 15px;
    	margin: 0px;
    	background-color: #fff;
    	}

    PHP:

    <?php
    /*
    Template Name: Blog
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    		<div class="postarea">
    
                <?php $wp_query = new WP_Query(array('cat'=>ot_option('blog_cat'),'showposts'=>ot_option('blog_cat_num'),'paged'=>$paged)); ?>
    			<?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
                <?php global $more; $more = 0; ?>
    
    [etc etc]
Viewing 1 replies (of 1 total)
  • Hey there,

    First, you should never have multiple elements with the same ID. Your loop is creating posts that all have the same ID of “postblock”. You should change that to a class.

    If I’m not mistaken, it seems as though you want to make the postarea div all gray, so to do that you can float that div left and add a background color:

    .postarea {
        background-color: gray;
        float: left;
    }

    And then if you want to make your posts have a white background, you could add some margin and change the 100% width like so:

    If you change postblock to a class

    .postblock {
        background-color: #FFFFFF;
        margin: 10px;
        width: inherit;
    }

    If you don’t

    #postblock {
        background-color: #FFFFFF;
        margin: 10px;
        width: inherit;
    }

    Hopefully this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Need space between posts. Only post area in php’ is closed to new replies.