• I want to show only title of posts in catagory pages, do not want detail of posts. Can anyone help me how to do that.

    My archive page is as under.

    <?php get_header(); ?>

    <div id=”content”>

    <?php if(function_exists(‘wp_page_numbers’)) { wp_page_numbers(); } ?>

    <?php if (have_posts()) : ?>

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

    <div class=”pdate”><?php the_time(‘M’); ?> . <?php the_time(‘j’); ?> . <?php

    the_time(‘Y’); ?></div>
    <h1 id=”cath1″>” rel=”bookmark”><?php

    the_title(); ?></h1>
    <div style=”clear:both;”></div>
    <div class=”date”>

    • <?php the_author_posts_link(); ?> in category: <?php the_category(‘, ‘) ?>

      |

    • <li class=”comment”><?php comments_popup_link(‘Leave a Comment’, ‘One

      Comment’, ‘% Comments’); ?>

    </div>

    <div style=”clear:both;”></div>

    <div id=”postarea”>

    <div style=”clear:both;”></div>

    <?php if( get_post_meta($post->ID, “preview”, true) ): ?>
    ” rel=”bookmark”><img class=”preview”

    src=”<?php echo get_post_meta($post->ID, “preview”, true); ?>” alt=”<?php the_title(); ?>” />
    <?php else: ?>
    <?php endif; ?>

    <?php the_content(); ?>
    <div style=”clear:both;”></div>
    </div>
    <?php endwhile; ?>

    <?php if(function_exists(‘wp_page_numbers’)) { wp_page_numbers(); } ?>

    <?php else : ?>

    <h2 class=”center”><?php _e(‘Not Found’); ?></h2>
    <p class=”center”><?php _e(‘Sorry, but you are looking for something that isn’t

    here.’, ‘kubrick’); ?></p>
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • there are a lot of problems with the code you have above, but to do what you want, in between the while(have_posts()) : the_post(); and endwhile; you should just have the_title()

    if that is your archive page, editing it will affect all archive views….

    if you just want to edit how things appear while viewed as category, then copy that file, rename to category.php and then make your edits. That new template will then only be used for category vi=ew

    voodoo is correct…i apologize for my oversight =/

    i apologize for my oversight

    lol, I’m not sure it was an oversight…. that may be exactly what @venusww was after….. I just wanted to point out the alternative, just in case

    well, to me it was an oversight. maybe it wouldve worked fine for him, but for someone else reading this for a similar problem, it may have broken another aspect of their site, so in that regard, it was an incomplete solution.

    oh, and @venusww, make sure to use https://www.pastebox.com in the future when pasting code

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to add only posts title in catagory pages’ is closed to new replies.