Forums

using <!--more--> on category archive only (5 posts)

  1. jimotman
    Member
    Posted 2 years ago #

    hi.. is it possible to use <!--more--> only when people view the category archive only? I mean, when people view my category archive, they will not see the whole posts, just some first part of the posts which I divide using <!--more--> or maybe it can automatically make a summary of the posts like in the rss feed.

    But when they view the main page, they will see the whole posts.

    Thanks.

  2. moshu
    Member
    Posted 2 years ago #

    If you want "whole post on the main page" - dont'use the "more".
    Instead replace the_content tag in your archive.php file with the_excerpt.
    Warning: it is archive.php (singular!) not archives.php, which is completely different thing!

  3. Sivar
    Member
    Posted 2 years ago #

    You could work with excerpts. There is an excerpt plugin (the_excerpt Reloaded), which allows for some customising like length of the excerpts.

    Then you'd have to put something like this into your index:
    if (is_category()) { the_excerpt_reloaded(options); } else { the_content(); }

    edit: too slow ;)... but the plugin might still be worth a look! Oh yes, and I presumed, your category archives would be displayed by your index.php

  4. jimotman
    Member
    Posted 2 years ago #

    thanks, it works! But why after I replace the_content with the_excerpt in the archive.php file, the images in the posts are gone? I have small images in the first part of my posts. Is there any other way so that the images are still shown?

    Thank you.

  5. Sivar
    Member
    Posted 2 years ago #

    If you had checked out the plugin I suggested, you wouldn't ask. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.