Support » Fixing WordPress » Need help displaying more lines of my posts

  • Hi Fellow ‘pressers,

    This is a long post, so I’ll start with the question: what change do I need to make to my index.php so that when a reader clicks on a category or date on the calendar, the resulting displayed post shows more than 4 or 5 lines (ideally all lines).

    I am using the Neo-Sapien theme for my blog ( In the theme, the loop as follows:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    	<div class="post" id="post-<?php the_ID(); ?>">
    <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="entry">
    <?php the_content('Read more…'); ?>
    <p class="postmetadata">
    <?php the_time('F jS, Y') ?>
    <?php _e('Categories:'); ?> <?php the_category(', ') ?> . <?php _e('Author:'); ?> <a href="<?php the_author_url(); ?>"><?php the_author(); ?></a> . <?php _e('Comments:'); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> <?php edit_post_link('Edit this entry', '', ''); ?>
    <?php endwhile; ?>
    	<div class="navigation"><?php posts_nav_link('','','Previous page') ?> <?php posts_nav_link('','Next page','') ?></div>
    <?php else : ?>
    	<div class="post">
    <div class="post-title><h2><?php _e('Not Found'); ?></h2></div>
    <div class="entry"><?php _e('Sorry, but you are looking for something that isn't here.'); ?></div>
    <?php endif; ?>

    What do I change? If showing all lines isn’t possible (or a good idea), how do I get the “read more” to show up? Right now there’s a […] where it cuts off but it’s not a hyperlink.



Viewing 3 replies - 1 through 3 (of 3 total)
  • look in your theme’s archive.php file or possible category.php file if your theme has the latter, and find something like the_excerpt() and change that to the_content() – either of those could be get_the_excerpt() or get_the_content() depending on how the theme is designed.

    the_excerpt() displays a portion of the post, the_content() displays then entire content of a post (or page depending on the template file).

    Awesome! That solved it!

    For any other inexperienced people like me that may read this, changing the_excerpt to the content in category.php changes the way a post displayed after clicking on a category (duh) and when changing it in archive.php it changes it when clicking it on the calendar.

    Thanks a million wpsec!

    Just keep in mind that if a theme doesn’t have a category.php file then WordPress will use archive.php instead, if that one exists.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need help displaying more lines of my posts’ is closed to new replies.