treehouse : what would you like to learn today?
Web Design Web Development iOS Development

My Personal Site - Some WP questions

  • Now that I've finished my first ever full featured wordpress theme, my attention has turned to my un-widgetized blog: http://tannercampbell.com

    I've widgetized it, all is good. My purpose is really just to employ the ability to for users to find content through categories and such ...

    My question is ... what .php file is Wordpress defaulting to when it displays posts by category? I can't be any that I have currently because the categories results do not contain previous/next links at the bottom like my index.php page.php and single.php pages do. I read the Codex concerning hierarchy, and it leads me to believe that it defaults to the slug (my-blog-post for example).

    Should I create a category.php?

    Thanks for any help!
  • Yes, create category.php!
  • Doc think I'm effing the loop up. I've got loop - category stuff - end loop.

    Im messing up somewhere. Is this not right?
  • The Previous/Next link is actually in loop.php.
    You may need a different "loop" template since your category page is different from normal post listing.
  • I'll show you what my category.php looks like on a site I'm developing right now:
    <?php get_header(); ?>



    <h1 id="headline"><?php single_cat_title(); ?></h1>

    <div id="content" role="main"> <!-- open CONTENT -->

    <?php the_content(); ?>

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    <div class="blog-post">
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <p class="date"><em><?php echo get_the_date(); ?></em></p>

    <?php the_excerpt(); ?>

    <p><a href="<?php the_permalink(); ?>">Continue reading &raquo;</a></p>
    </div>

    <?php endwhile; ?>

    <div class="clear"></div>

    </div> <!-- close CONTENT -->

    <?php get_sidebar('blog'); ?>

    </div> <!-- close MAIN -->

    <?php get_footer(); ?>

    You'll see it's very simple, but that's all I required for this site.