layers_excerpt_class()

Since: 1.0 Last Updated:
Back to Main Index

Hooks into the_excerpt and get_the_excerpt to filter the output. This filter is useful for setting a custom wrapper or class on automatically generated excerpts.

Location: functions.php

Usage

In the original example, we look for the original <p>  wrapper and replace it with <p class="excerpt">  and output the excerpt with $excerpt. You could replace <p>  with a different wrapper such as <div>  but then remember to add a second str_replace  for the </p>