• Ok, I can’t find an answer anywhere so here I am. On this site here https://musicmonsterlive.com/content/category/artists/ it shows the entire article instead of just a snippet in the category sections and it’s driving me crazy trying to find the answer of how to limit the characters.

    I’m not even a hundred percent which file I should be looking through.

    I have:
    Archive

    <?php get_header(); ?>
    <div id="main">
    <div id="main-2">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="rpa">
    <div class="post-title"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <div class="post-meta">Posted by <?php the_author(); ?> on <?php the_time('l F, jS'); ?> in <?php the_category(', ') ?></div>
    <div class="post-text"><?php the_content('read more &raquo;'); ?></div>
    </div>
    <?php endwhile; ?>
    <?php endif; ?>
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    </div>
    </div><!-- main close -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Archives

    <?php get_header(); ?>
    <div id="main">
    <div class="featured">
    <div class="featured-content"><img src="images/featured.jpg" alt="Featured" /></div>
    </div>
    <?php $gsi=1; ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); $gsi++; ?>
    <div class="<?php if($gsi%2==0) { echo "home-post-even"; } else { echo "home-post-odd"; } ?>">
    <div class="home-post-thumb"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("thumb"); if($values[0] == "") { echo bloginfo('template_directory').'/images/thumb.gif'; } else { echo $values[0]; } ?>" alt="<?php the_title(); ?>" class="thumb" border="0" />
    </a></div>
    <div class="home-post-title"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <div class="home-post-meta">By: <?php the_author(); ?><br />
      <a href="<?php the_permalink() ?>"><u>Read more of this article &raquo;</u></a></div>
    </div><!-- home-post-even close -->
    <?php comments_template(); ?>
    <?php endwhile; else: ?>
    <h2>Reuested page is not here!</h2>
    <?php endif; ?>
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    </div><!-- main close -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    single

    <?php get_header(); ?>
    <div id="main">
    <div id="main-2">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="rpa">
    <div class="post-title"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <div class="post-meta">Posted by <?php the_author(); ?> on <?php the_time('l F, jS'); ?> in <?php the_category(', ') ?></div>
    <div class="post-text"><?php the_content('read more &raquo;'); ?></div>
    </div>
    <?php comments_template(); ?>
    <?php endwhile; ?>
    <?php endif; ?>
    </div>
    </div><!-- main close -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Any help is very much appreciated. Even if it’s

Viewing 3 replies - 1 through 3 (of 3 total)
  • If all your posts have excerpts you can use the_excerpt() instead of the_content(). Or you can make sure all posts have the <!--more--> break to seperate what you want as the text before Read More..

    Thread Starter wallarookiller

    (@wallarookiller)

    Can you elaborate some more maybe show an example? Please.

    wallarookiller,

    Assuming your posts have excerpts written for each of them you can use the_excerpt(); instead of the_content(); as suggested above like below. I’ve shortened the code a little so you can see the change clearly.

    <div class="post-meta">Posted by <?php the_author(); ?> on <?php the_time('l F, jS'); ?> in <?php the_category(', ') ?></div>
    <div class="post-text"><?php the_excerpt('read more &raquo;'); ?></div>

    If you do not have excerpts written for each post you can try the following plugin: Limit Posts – https://www.doc4design.com/plugins/limit-post/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Limit Text For Each Post on the Catagory Page?’ is closed to new replies.