Forums

splitting post text into two columns (2 posts)

  1. jaioxung
    Member
    Posted 2 years ago #

    I am bringing a single post from my wordpress blog into my static site's homepage. What I want to do is split this post's text into two parts so I can display the first half in the left <div> and the second half in the right <div>.

    Here is my code (simplified) so far:

    <!--start left column - to include title and first half of the post's text-->
    <div>
    	<?php query_posts(); ?>
    
            	<?php while (have_posts()) : the_post(); ?>
    
    		    <h4><?php the_title(); ?></h4>
                        <div>
                        <?php the_content(); ?><!--should only be the first half-->
                        </div>
    </div>
    
    <!--start right column - contains image at top, but needs the remainder of the post's text below it-->
    
    <div>
    	<?php $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $post->ID );
    foreach( $images as $imageID => $imagePost )
    echo wp_get_attachment_image($imageID, array(174,174)); ?></div>
    
    <!--rest of the post's text should go here-->
    <?php endwhile; ?>
    
    </div>

    Also, can you bring in 'the_content' without it's image coming along with it? As you can see I am bringing in the image separately so I can size and place it manually.

  2. buddhi
    Member
    Posted 2 years ago #

    check this out and see if it helps.. http://tugbucket.net/wordpress/two-column-magazine-style-posts-in-wordpress/

    i came across this while searching for something similar..

Topic Closed

This topic has been closed to new replies.

About this Topic