WordPress.org

Support

Support » Plugins and Hacks » Page excerpts plugin?

Page excerpts plugin?

  • 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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

    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.

    “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.

    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>

    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>

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

    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!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Page excerpts plugin?’ is closed to new replies.
Skip to toolbar