Customizing Category pages (5 posts)

  1. FairlyClever
    Posted 11 years ago #

    How would I make it so on the Category pages, it only shows the title of the entries and not the whole thing?

  2. codergurl
    Posted 11 years ago #

    Maybe something like:
    <?php if ($cat || $category_name) : ?>
    <?php the_title(); ?>
    <?php else : ?>
    regular template here
    <?php endif; ?>

  3. FairlyClever
    Posted 11 years ago #

    Not like that, I mean when I'm on a page that displays all the posts in a category, say http://fairlyclever.com/categories/FairlyClever how would I make it only display the entry titles as links to the entry rather than the whole entry?

  4. planetphillip
    Posted 11 years ago #

    This is what I use:

    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <div class="post">
    <?php if (!$cat){?>
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>

    <div class="storycontent">
    <?php the_content(); ?>
    Posted: <div class="updated"><?php the_date(); ?></div>
    <div class="date"><?php edit_post_link(); ?></div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('No comments yet'), __('Just 1 comment'), __('% Comments')); ?>
    <?php trackback_rdf(); ?>
    <?php include(ABSPATH . 'wp-comments.php'); ?>
    <h3><?php single_cat_title(name); ?> </h3>
    <?php } else { ?>

    <?php } ?>
    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    Somebody very helpful (can't remember who - sorry) gave me the code in a previous thread.
    You'll need to chnage the code a bit to suit the layout but it should work.
    You can see it in action on my site, which is visible via my username.

  5. FairlyClever
    Posted 11 years ago #

    Thanks alot man, I appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.