• I just read a recent post about unique site structure, and I think my question is related, bit different.

    I want to make the main landing page for my installation to look considerably different than the individual blog pages. Specifically, I want a number of columns (three or four) that are populated with dynamically-generated lists of links by specific category. I don’t really want the main landing page to have too much content… just little snippets, followed by a link.

    If I was coding a static page, this would be no problem, but I want to be able to link back to the blog contents.

    Any help would be greatly appreciated!

Viewing 1 replies (of 1 total)
  • That’s quite commonly done these days (lucky you!) with category calls. You’ll need to decide which categories you want to appear on the front page and find their ID numbers. Hover your mouse over the category in the category listing in the WP Dashboard. You’ll want to write down the ID numbers of the categories you want displayed on that front page.

    Then you’ll design a box or section for each category. For each category, you’ll use this code or similar:

    <?php $cat1 = new WP_Query('cat=75&showposts=1'); ?>
    <?php if($cat1->have_posts()) : ?>
    <?php while($cat1->have_posts()) : $cat1->the_post(); ?>
    <h3 class="cattitle"><a href="<?php the_permalink() ?>"
    rel="bookmark"><?php the_title(); ?></a></h3>
    <div class="meta"><?php the_date(); ?> <span class="edit"><?php
    edit_post_link('[Edit]'); ?></span></div>
    <?php
      $excerpt = get_the_excerpt();
      echo string_limit_words($excerpt,20);
    ?><br /><a href="<?php the_permalink() ?>" rel="bookmark"><strong>More &raquo;</strong></a>
    <?php endwhile; ?>

    You’ll make one, possibly two, changes. First:

    <?php $cat1 = new WP_Query('cat=75&showposts=1'); ?>

    Change cat=75 to whatever category you want.

    Second, you may not want to limit the number of words:
    echo string_limit_words($excerpt,20);

    So you can either change the value 20 to something else or remove it completely, like this:
    echo string_limit_words($excerpt);

    You’ll notice some styling hooks in there, class cattitle and others. Feel free to change those around according to your style/design.

    Also, for each category you want to appear on the front page, you just change $cat1 to $cat2, etc. for as many categories as you want appearing on the front page.

    Hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘More (different) unique site structure’ is closed to new replies.