WordPress.org

Ready to get started?Download WordPress

Forums

Entry Excerpts outside of RSS feeds? (5 posts)

  1. greghaspants
    Member
    Posted 10 years ago #

    Okay, I am probably missing something terribly obvious with this, but I'll ask anyway. Is it possible to put the excerpt of an entry anywhere on a website, besides in an RSS feed? If so, how?
    I'd like to have this for my archives index pages. Say, for instance, by month, by year, etc. I figure that providing a short excerpt along with each title would make the site easier to use, with some sort of <dl><dt>Title</dt><dd>Excerpt</dd></dl> scheme as the structure.
    I would assume there's a function to do this, but I can't find any such function in the official list. Any ideas on how to do this?

  2. davidchait
    Member
    Posted 9 years ago #

    the_excerpt, or get_the_excerpt, or the_excerpt_rss.... depending on what you want it to do (echo, return), and what formatting you want done to it. probably another tag or two.
    -d

  3. superkim
    Member
    Posted 9 years ago #

    Though it would be nice, if there was some kind of doc. - parameters and so..
    I plan to have my archive using a special file, like arkiv.php (arkiv is danish for archive), which will make excerpts instead of content, but then one have to deal with the individual files, which must have all the content. Too few combinations in the settings for the moment, I think..

  4. superkim
    Member
    Posted 9 years ago #

    Okay, it wasn't so hard to do after all. I am not a php-programmer - yet ;-) , but I managed to do this:
    In the index.php file (You don't need a special archive file for this) SUBSTITUTE
    <div class="storycontent">
    <?php the_content(); ?>
    </div>
    WITH
    <div class="storycontent">
    <?php
    if ((! empty($_GET['p'])) OR (( empty($_GET['cat'])) AND ( empty($_GET['m']))))
    the_content();
    else
    the_excerpt();
    ?>
    </div>
    It seems to work like this: On the front page and on the individual postings, you have your posts in full length - on the category pages and on the monthly archives you have only the excerpts.
    Thanks for the help, david
    /kim

  5. gvtexas
    Member
    Posted 9 years ago #

    Kim -
    Did this ever go anywhere? (as in, did it work for you?) I tried it but it shows the same content on the cat archives as individual or front page (and I do have content in the excerpt field in the post I tested with).
    Thanks,
    Gary

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.