WordPress.org

Ready to get started?Download WordPress

Forums

make the continent of the main page appear in two columns (4 posts)

  1. hun4r
    Member
    Posted 3 years ago #

    is that possible to make the continent of the main page appear in two columns instead of one. so the length of the main page will reduce?

  2. hun4r
    Member
    Posted 3 years ago #

    any answer !

  3. Tomas Mackevicius
    Member
    Posted 3 years ago #

    yes, you need custom loop (or modified loop)

    <?php /* How to display index page */ ?>
    	<?php elseif (is_home () ) : ?>
    
    			<div class="TwoColPostList <?php echo $odd_or_even; ?>">
    
    				<div class="entry-meta">
    					<?php the_time('Y-n-j') ?> | <?php comments_popup_link( __( 'No Comments! »', 'twentyten' ), __( '1 Comment »', 'twentyten' ), __( 'Comments: %', 'twentyten' ) ); ?>
    				</div><!-- .entry-meta -->
    
    				<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    
    				<div class="TwoColPostListExerpt"><a href="<?php the_permalink() ?>">
    					<?php if(!has_post_thumbnail()){ ?>
    						<img src="<?php bloginfo('template_directory'); ?>/images/no_thumb.jpg" alt="<?php the_title(); ?>" />
    					<?php }else { the_post_thumbnail(array(125, 125)); } ?></a> <?php /* Asigning thumbnail image width and height if it is diferent than default (still should be enforced through CSS too). To get default thumbnail size use: the_post_thumbnail(thumbnail} */ ?>
    					<?php the_excerpt(); ?>
    				</div>
    			</div>
    
    			<?php if ($odd_or_even == 'post-even') echo "<div class=\"TwoColPostListSeparator\"></div>"; ?><?php /* if there is an even post, insert separator div after it */ ?>
    
    			<?php $odd_or_even = ('post-odd'==$odd_or_even) ? 'post-even' : 'post-odd'; ?>
  4. Tomas Mackevicius
    Member
    Posted 3 years ago #

    of course you will need to style it with css so they would appear in 2 columns.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.