1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress category view

Discussion in 'WordPress' started by login, Mar 12, 2008.

  1. #1
    How can I limit the category view in wordpress to just show the post titles and not anything of the post content?

    Greeeeeen rep to good answers :)
     
    login, Mar 12, 2008 IP
    sultanofseo likes this.
  2. NsaneNoob

    NsaneNoob Peon

    Messages:
    2,103
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #2
    NsaneNoob, Mar 12, 2008 IP
  3. sultanofseo

    sultanofseo Notable Member

    Messages:
    9,930
    Likes Received:
    405
    Best Answers:
    0
    Trophy Points:
    265
    #3
    in the archive.php file, you can change from 'content' to 'excerpt' which will show the excerpts under category view. if you want only title, then you can follow the link here
     
    sultanofseo, Mar 12, 2008 IP
    login likes this.
  4. login

    login Notable Member

    Messages:
    8,849
    Likes Received:
    349
    Best Answers:
    0
    Trophy Points:
    280
    #4
    Thanks a lot sultanofseo. I found it.

    In the theme index.php file, Replace this:

    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_date('','<h2>','</h2>'); ?>
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @<?php the_time() ?>
    </div>
    <div class="storycontent">
    <?php the_content(); ?>
    </div>
    <?php include(ABSPATH . 'wp-comments.php'); ?>
    </div>
    <?php endforeach; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    </div>



    With this:





    <div id="contentcenter">
    <?php

    $temp_category = single_cat_title('',false);
    if (!empty($temp_category)){
    // give index
    ?>

    <h1><?php single_cat_title(); ?></h1>

    <p><?php echo(category_description(the_category_ID(false))); ?></p>
    <p class="index">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a><br>
    <?php endforeach; else: ?>
    </p>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>


    <?php
    }else{ // give details or single post
    ?>
    <!-- if post give full detail.. otherwise if index give top x.. otherwise get all -->
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

    <h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h1>

    <div class="meta">posted on <?php the_date(); ?> at <?php the_time(); ?> in <?php the_category('','') ?> </div>

    <?php the_content(); ?>

    <div class="meta">
    <?php wp_link_pages(); ?>
    </div>

    <!--
    <?php trackback_rdf(); ?>
    -->


    <?php include(ABSPATH . 'wp-comments.php'); ?>

    <?php endforeach; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif;
    } // end if index or detail
    ?>

    </div>
     
    login, Mar 13, 2008 IP
  5. sultanofseo

    sultanofseo Notable Member

    Messages:
    9,930
    Likes Received:
    405
    Best Answers:
    0
    Trophy Points:
    265
    #5
    great, thanks. i never thought of using just titles in my category view but looks lot clean if you do, i will give this a try myself :)
     
    sultanofseo, Mar 13, 2008 IP
  6. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #6
    are you talking about a results page (such as, click a category, search the site or click a tag and see a list of sites afterwards?) Those are covered in the Archive & search pages of your template, all you'd have to do is remove the code that calls anything but the title, and only the titles would show up.
     
    Pixelrage, Mar 13, 2008 IP