• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Content Modeling for WordPress
    • WordPress Hidden Gems
    • Web Design
  • Work
    • MLIS Class Projects (2019-2022)
    • Portfolio (2002-2019)
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →

Stephanie Leary

Writer, WordPress consultant, recent MLIS grad

  • About
    • Press Kit
    • Presentations and Interviews
  • Contact Me

Post and Page Excerpt Widgets

A widget to display excerpts from posts or pages in the sidebar. You may use ‘more’ links and/or link the widget title to the post or page.

Requires Page Excerpt or Excerpt Editor for page excerpts. Supports the_excerpt Reloaded and Advanced Excerpt.

download at wordpress.org get support at wordpress.org donate to future development

If you’d rather not use a widget, here’s the more or less equivalent code for your template (which does not require you to install this plugin).

For pages:

<?php
	// page title
	echo = '<a href="'.get_permalink($post->ID).'">'.the_title().'</a>'; 
	// custom Loop
	$page_query = new WP_Query('page_id='.$post->ID); 
	while ($page_query->have_posts()) : $page_query->the_post(); 
	// the excerpt of the page
	if (function_exists('the_excerpt_reloaded')) 
		the_excerpt_reloaded(100, '<p><div><span><br /><img /><a><ul><ol><li><blockquote><cite><em><i><strong><b><h2><h3><h4><h5><h6>', 'content', FALSE, ", ", '1&#8242;, ");
	else the_excerpt(); // this covers Advanced Excerpt as well as the built-in one
	endwhile; // end custom Loop
?>

For posts, the query is slightly different:

<?php
	// page title
	echo = '<a href="'.get_permalink($post->ID).'">'.the_title().'</a>'; 
	// custom Loop
	$post_query = new WP_Query('p='.$post->ID); 
	while ($post_query->have_posts()) : $post_query->the_post(); 
	// the excerpt of the page
	if (function_exists('the_excerpt_reloaded')) 
		the_excerpt_reloaded(100, '<p><div><span><br /><img /><a><ul><ol><li><blockquote><cite><em><i><strong><b><h2><h3><h4><h5><h6>', 'content', FALSE, ", ", '1&#8242;, ");
	else the_excerpt(); // this covers Advanced Excerpt as well as the built-in one
	endwhile; // end custom Loop
?>
You are here: Home / Code / WordPress Plugins / Post and Page Excerpt Widgets

Footer

My Books

I’m a front end developer at Equinox OLI, working on open source library software. I was previously a freelance WordPress developer in higher education. You can get in touch here or on LinkedIn.

Copyright © 2023 Stephanie Leary · Contact