A user asked:
I am using the Genesis Author Pro plugin. I need the Excerpt from the Excerpt meta box to display under the title on the book archive page and also on the single book pages.
The templates for single book and books archive pages in the Genesis Author Pro plugin remove all the standard hooks and add a few custom ones. We can hook the excerpts to appropriate location in the desired location in between these custom add_action lines of code, after copying the templates over to the child theme directory.
Sample screenshots of what we are aiming for:
books
CPT single page:
books
CPT archive page:
If a manual excerpt is not present, the first few words (default is 55) will be shown.
Step 1
Add the following in child theme's functions.php
:
/**
* Show Excerpt.
*/
function sk_show_excerpt() {
echo '<div class="book-excerpt">';
the_excerpt();
echo '</div>';
}
Step 2
Create a file named single-books.php
in the child theme directory having the following code:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Thanks Sridhar! It works perfect!