• Resolved miletjs

    (@miletjs)


    Hello

    How can i make my wordpress lists the title of the posts when pressing a specific category instead of displaying the whole post?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter miletjs

    (@miletjs)

    I have already figured this out

    For those folks searching for the same issue, here’s what I did

    replace your THE_LOOP section. In a nutshell, I deleted the following from my category.php file

    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<div class="post" id="post-<?php the_ID(); ?>">
    
    <div class="post-content">
    	<li>
    		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> @ <?php the_time('F jS, Y') ?> <?php edit_post_link(', Edit'); ?>
    	</li>
    </div>
    
    	<?php endwhile; ?>
    <div id="nav">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    </div>
    	<?php else : ?>
    		<h2>Not Found</h2>
    		Sorry, but you are looking for something that isn't here.
    
    <?php endif; ?>

    And replaced it with

    <?php
     $categoryvariable=$cat; // assign the variable as current category
    ?>
    
    <ul>
    
    <?php $myposts = get_posts('category=' . $categoryvariable. '&numberposts=20&offset=0');
    	 foreach($myposts as $post) :
    	 setup_postdata($post);
     ?>
    
    <div class="post-content">
    	<li>
    		<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php 
    
    the_title(); ?></a> @ <?php the_time('m/d/Y g:i A') ?> <?php edit_post_link(' | Edit'); ?>
    	</li>
    </div>
    
    	 <?php endforeach; ?>
    </ul>
    
    <p>&nbsp;</p> <p>&nbsp;</p>
    
    <div id="nav">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    </div>

    I was about to do this but I can’t find the codes on 2.6, are there any ways I could set it up like this? what should i edit then? thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to list titles in categories’ is closed to new replies.