WordPress.org

Ready to get started?Download WordPress

Forums

Adding Lines between Posts (9 posts)

  1. Gavin5491
    Member
    Posted 4 years ago #

    I want to put lines between my posts on main page, like this:

    Image

    Currently in index.php is:

    <table cellpadding="20" cellspacing="20" border="0"> 
    
    <?php
    $col = 0;
    $cols_per_row = 2;
    while (have_posts()) : the_post();
      if($col == 0) echo '<tr>';
      ?>
      <td class="column'<?php echo $col; ?>" style="vertical-align: top">
      <div class="post" id="post-'<?php the_ID(); ?>'">
    	<b><h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2></b>
    	<div class="descr"><?php the_time('l, F jS Y, G:i a T'); ?></div>
    	<div class="entry">
    	  <?php the_content('Read the rest of this entry &raquo;'); ?>
    <a href="<?php the_permalink(); ?>"
    <img src="http://www.tamileelamonline.com/wp-content/uploads/fullstory1.png" ALIGN="right" WIDTH="95" HEIGNT= "40" />
    </a>
    	</div>
    
    <br /><br /><br />
      </div>
      <td>
      <?php
      if($col++ >= $cols_per_row){
    	$col = 0;
    	echo '</tr>';
      }
    endwhile;
    ?>
    
    </TD>
    </table>
  2. esmi
    Forum Moderator
    Posted 4 years ago #

    A link to your site might help...

  3. Gavin5491
    Member
    Posted 4 years ago #

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Your posts already have borders at the bottom. And bottom margins. What else is it that you want?

  5. Gavin5491
    Member
    Posted 4 years ago #

    Basically what you see is a background on the table:

    <table cellpadding="20" cellspacing="20" border="0" background="http://www.tamileelamonline.com/wp-content/uploads/lines3.png">

    So when the post changes, the lines get close, like this

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Try edting style.css and changing:

    .post {
    margin:6px 0 2px;
    }

    to:

    .post {
    height:350px;
    margin:6px 0 2px;
    border-bottom:1px solid #ccc;
    }
  7. Gavin5491
    Member
    Posted 4 years ago #

    Thank you very much!

    Is it possible to put a Vertical line?

  8. esmi
    Forum Moderator
    Posted 4 years ago #

    border-left and border-right can be used in the same way as border-bottom.

  9. lionnes
    Member
    Posted 3 years ago #

    hello
    I am using wordpress 3.0.1 desciple theme

    I just added

    .post {
    margin-bottom: -25px;
    }
    at the end of my style sheet to reduce space between posts. I will love to add lines between posts too.

    I added
    border-bottom:1px solid #000;
    after margin-bottom: -25px;
    and the result is two lines, wheras i just need one line

Topic Closed

This topic has been closed to new replies.

About this Topic