WordPress.org

Ready to get started?Download WordPress

Forums

Page excerpts plugin? (8 posts)

  1. privatestorm
    Member
    Posted 9 years ago #

    Does anyone know of a plugin that allows you to add excerpts to your pages? Or is there already a way in WP to add excerpts to pages without manually going into your database to add them? And yes, I'm talking about pages not posts.

    I have installed a search plugin that searches both pages and posts. This works great but when the search results are displayed they show the entire page contents because pages do not have excerpts. For posts it displays the excerpts. I want to create an excerpt for the pages so that the search results will only show the page excerpts and not the entire page contents.

    It seems strange to me that WP has a textarea for creating/editing excerpts for posts but not for pages. Or am I just missing something?

  2. tomhanna
    Member
    Posted 9 years ago #

    WordPress automatically creates an excerpt out of the first 120 characters for posts. If it's not doing that automatically for Pages, I suspect it is because Pages don't have an excerpt.

  3. pcmt
    Member
    Posted 9 years ago #

    I'm using David B. Nagle's Search Pages plugin. When I search, the results show excerpts for pages as well as posts. I'm using 1.5.3 standard install.

  4. privatestorm
    Member
    Posted 9 years ago #

    "If it's not doing that automatically for Pages, I suspect it is because Pages don't have an excerpt."

    Yeah, no kidding. But since there is a field in the database for excerpts for pages (not just for posts) there should also be a way for us to create/edit a page excerpt. I don't want automatically generated excerpts for pages either. If nothing already exists then maybe I'll just have to put together a hack/plugin on my own.

  5. privatestorm
    Member
    Posted 9 years ago #

    I had a chance to look at the admin pages this evening and I have found that this is actually an easy thing to add to the pages edit form (copied and pasted from the posts advanced form):

    Open the wp-admin/edit-page-form.php file and add this fieldset between the pageparent and postdiv fieldsets.

    <br />
    <fieldset id="postexcerpt">
    <legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="<?php _e('Help with excerpts') ?>"><?php _e('Excerpt') ?></a></legend>
    <div><textarea rows="1" cols="40" name="excerpt" tabindex="4" id="excerpt"><?php echo $excerpt ?></textarea></div>
    </fieldset>

  6. RandomWhim
    Member
    Posted 8 years ago #

    For WordPress 2.0:

    Beaneath <div id="advancedstuff" class="dbx-group"> add:

    <fieldset id="postexcerpt" class="dbx-box">
    <h3 class="dbx-handle"><?php _e('Optional Excerpt') ?></h3>
    <div class="dbx-content"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div>
    </fieldset>

  7. dylan
    Member
    Posted 8 years ago #

    Why isn't it a default ability to edit the excerpt of a page?

  8. jdandrea
    Member
    Posted 7 years ago #

    I second that (or third that?) - out-of-the-box ability to edit a page excerpt would be wonderful.

    Meanwhile, I've added the snippet from RandomWhim and it works just fine - thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags