• Hi,

    Im trying to change the excerpt length shown in the post previews on the homepage. the loop php file is currently outputting ‘the_excerpt();’ in order to get the default output.

    i have tried a few plugins, recommended functions to function.php and even modify the core file in wp-include, but everytime i get the same results – which is no change.

    could anyone give me a hand with this ?

    thank you

Viewing 4 replies - 16 through 19 (of 19 total)
  • @zubair04

    B.T.W.
    The two column posts look great when the text is the same, create a post with different sizes of words and you might find that the posts get out of line.

    If you look at the page the two columns widths do not align with the header image, this is due to the right margin in the second column.

    [——Header—–]
    [Post 1]-[Post 2]-
    [Post 3]-[Post 4]-

    I use a different class for the left and right columns, and this makes the posts line up nice across the page and where the text is shorter or longer, clear both on the left and no margin on the right.

    .column-left{
    	clear: both;
    	float: left;
    	position: relative;
    	margin-right: 7.6%;
    	width: 46%;
    }
    
    .column-right{
    	float: left;
    	position: relative;
    	width: 46%;
    }

    Then in the content or loop I add a counter variable.

    <?php $counter = 0; ?>
    <?php while ( have_posts() ) : the_post(); ?>
    	<?php $counter++; //Increment the Counter ?>
    	<?php if($counter % 2) : ?>
    		<div  class="column-left">
    	<?php else: ?>
    		<div  class="column-right">
    	<?php endif; ?>	
    
    		<!-- Post Output Code Here -->
    
    		</div>
    <?php endwhile; ?>

    Just thought I would add this comment as you might want to revisit the layout with different content values.

    HTH

    David

    Thread Starter zubair04

    (@zubair04)

    this is a problem that i was about to deal with next, as i put in a temporary measure to change to layout to this.

    thanks very much david for this code, i will try and implement this now and see how it works.

    much appreciated !

    Thread Starter zubair04

    (@zubair04)

    ive tried implementing the code and if u visit the site , the posts are just repeated infinitely 😐

    would anyone mind taking a look and see where im going wrong with this ?

    thanks again

    Thread Starter zubair04

    (@zubair04)

    …sorted out now.

    thanks everyone for your help, saved me a lot of time

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Changing Excerpt Length’ is closed to new replies.