WordPress.org

Ready to get started?Download WordPress

Forums

The Bootstrap
[resolved] Create 2 Columns on Category/archive pages (4 posts)

  1. stemie
    Member
    Posted 1 year ago #

    Hi, Im trying to get two columns on my category and archives pages.

    I have reduced the width of the looped content to span4 and created a div class called .arch with a float left property

    <div class="span4 arch">
    			<?php
    			while ( have_posts() ) {
    				the_post();
    				get_template_part( '/partials/content-archives', get_post_format() );
    			}
    			the_bootstrap_content_nav();
    		else :
    			get_template_part( '/partials/content', 'not-found' );
    		endif;
    
    		tha_content_bottom(); ?>
    </div><!-- .arch -->

    This doesn't work. Is it possible to make two columns with this theme?

    http://wordpress.org/extend/themes/the-bootstrap/

  2. Did you try wrapping it with a <div class="row"> ?
    Have a look at Bootstrap's Grid System documentation to learn more.

    Konstantin

  3. stemie
    Member
    Posted 1 year ago #

    Yea sorry I noticed that after I sent the message.
    I cannot get it to work in the loop though.

    The below code is sitting in the .span8 class so there should be enough space to fit in two columns but it only shows one column.

    <div class="row">
    	<div class="span4">
    			<?php
    			while ( have_posts() ) {
    				the_post();
    				get_template_part( '/partials/content-archives', get_post_format() );
    			}
    			the_bootstrap_content_nav();
    		else :
    			get_template_part( '/partials/content', 'not-found' );
    		endif;
    
    		tha_content_bottom(); ?>
            </div><!-- .span4 -->
    </div><!-- .row -->

    I guess I have to create and new instance of .span4 for each post that appears in the loop? If so any idea how would I do that?

  4. stemie
    Member
    Posted 1 year ago #

    Ok I solved it.

    I put the span4 inside the content loop so each post get wrapped in span4 div class and it creates two columns

    get_template_part( '/partials/content-archives', get_post_format() );

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic