• I’m using a customized version of twenty-ten (in a child theme). I’d like to change the archive pages for each category, and have them viewed as double columns. I’d also like to change the css, but that’s another issue.

    Right now, I’m linking my menu navigation to category links, which I believe uses archive.php. So My understanding is I will have to edit this file by creating a loop. I did find some code that I tried to use, but it ended up putting two columns in my navigation pane.

    I don’t’ want to use a plugin, because I would prefer to link directly to the category page without having to create a page for each category. Am I searching for the wrong thing? I’m struggling to find anyone who has done this, or clear instructions how

    http://discovernorthvancouver.com/category/north-vancouver/play-2/hikes/

    Ideally, would like it to look like the bottom middle, displaying 8 or 10 posts with a more link:
    http://vancouver.ca/parks-recreation-culture.aspx

Viewing 4 replies - 1 through 4 (of 4 total)
  • Twenty Ten has a category.php for the catgory archive pages;

    you could achieve a two-column layout without editing category.php, just by adding some filter for the post_class() into functions.php of your theme, and by adding some css to format the columns.

    however, to integrate what looks like the ‘featured image’ aka post thumbnail, you need to edit loop.php which gets called by category.php.

    as you said ‘customized version’ please start by pasting the full code of loop.php into a http://pastebin.com/ and post the link to it here – http://codex.wordpress.org/Forum_Welcome#Posting_Code

    Thread Starter lifefanatic

    (@lifefanatic)

    That one shouldn’t have been edited, but here it is!
    http://pastebin.com/Y7JJvsMC

    You’re right! It’s using category.php – no wonder I couldn’t get it to work. You’ve already helped a ton!

    this section is edited:

    <?php /* How to display all other posts. */ ?>
    
            <?php else : ?>
    <?php $alt_class = is_category()?($wp_query->current_post%2?array('half-width','even'):array('half-width','odd')):''; //generate css classes for 2-column category archive// ?>
                    <div id="post-<?php the_ID(); ?>" <?php post_class( $alt_class ); ?>>

    and this section:

    <?php if( is_category() ) {
    the_post_thumbnail(); //add the featured image into category archive; otherwise show postmeta//
    } else { ?>
                            <div class="entry-meta">
                                    <?php twentyten_posted_on(); ?>
                            </div><!-- .entry-meta -->
    <?php } ?>

    here is the full loop.php:

    http://pastebin.com/THQZ5aYQ

    minimal needed css:

    .half-width { width: 48%; float: left; }
    .half-width.odd { clear:left; margin-right: 3%; }

    might need fine adjustment of the thumbnail size etc.

    Thread Starter lifefanatic

    (@lifefanatic)

    Thank you thanks you!! I got it working- not I just have to play with the css to get it formatted nicely.

    MUCH appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Category Archives- Two Columns, Formatted?’ is closed to new replies.