Due to the issues cited above and the lack of support here, I have deactivated Customize Posts on all my sites …
@nealumphred Excerpts are usually only displayed when the content is not. So I think it is unusual to see both the_excerpt() and the_content() both appearing in the same template. The Twenty Seventeen theme does show excerpts: https://github.com/WordPress/wordpress-develop/blob/d88bb052f0feac443c55aa0903f2d70fd9715aa1/src/wp-content/themes/twentyseventeen/template-parts/post/content-excerpt.php#L43
On the search results, the excerpts are shown. They are also shown on the homepage blog panel. If you want excerpts to show in other places, then you can override the template in a child theme.
By default the_excerpt() shows a snippet of the content if the excerpt is empty. When a non-empty excerpt is supplied, then it overrides the snippet from the content. This is all working for me in Customize Posts. See video: https://youtu.be/sTt0SAjBNa4
W
You’ve lost me here: am I supposed to add those 47 lines of code to my sites? If so, where? As I don’t “do code,” I’d have to use a plugin in to implement the code.
N
To be honest I don’t understand the problem you are having to begin with. As you can see in my video linked above, excerpts work as expected in Twenty Seventeen.
W
Thanks for hanging in there with me.
To be honest I don’t understand the problem you are having to begin with the problem I’m having:
TwentySeventeen does not allow for excerpts of posts to display on the Blog Archives page.
I have to add the Advanced Excerpts plugins to have excerpts on that page.
When I open Customize Posts, I can only access the excerpt not the full post/article and therefore cannot customize the article.
To access the full article, I have to deactivate the Advanced Excerpt plugin.
In your response above, you provided a link to a 47-line snippet of code. Since I don’t know how to “do code,” I use the Code Snippets plugin by Shea Bunge. The 47-line snippet of code did not have any affect on my site.
The link to the video: since it doesn’t address my problem, I assume I am not getting that across. I want to see the entire published article, here is what I see:
http://www.nealumphred.com/customize-posts/
Hope this helps,
N
@nealumphred Ok, the problem then is that when the Advanced Excerpt plugin overrides the_content() to output the_excerpt(), it doesn’t also replace the containing element’s entry-content class name with entry-summary.
So I think what you should actually do is:
1. Deactivate the Advanced Excerpt plugin.
2. Create a child theme for Twenty Seventeen.
3. Save the following file in your child theme as template-parts/post/content.php: https://gist.github.com/westonruter/b924a2c6aaa746a477053472e06fc557
That should then give you the desired results. I’m able to override the excerpt in my Twenty Seventeen child theme when I do this on the year archives.
I have deactivated Advance Excerpt plugin.
I have a child theme.
How do I place code in child theme?
Where do I place the code in child theme?
Which part of code do I use?
All of this:
<?php
/**
* Template part for displaying a post, forcing the excerpt template part to be used on archives.
*
* Instructions: Place this file in your twentyseventeen child theme at template-parts/post/content.php
*
* @package Twenty_Seventeen
*/
if ( is_archive() ) {
get_template_part( ‘template-parts/post/content’, ‘excerpt’ );
} else {
include get_template_directory() . ‘template-parts/post/content.php’;
}
Yes, in your child theme make sure there is a template-parts/post directory, and then place all of the PHP into a content.php file in that directory. So it would then be located in your child theme as template-parts/post/content.php.
W
I’m afraid this is beyond me: I don’t know where to find a template-parts/post directory in a child theme.
I’m much better at writing letters to WordPress and ask them how they could be so #@*@#!!! stupid as to design this otherwise flexible and attractive theme without providing for excerpts for the blog archive page.
But plain old bloggers like myself don’t seem to be of much interest to WordPress these days . . .
N
You have to create the directory. You just create a directory called template-parts in your child theme. And then inside that directory, create another directory called post. Then place the content.php file into this post subdirectory of template-parts.
By “directory” do you mean “folder”?
Went to my cpanel and File Manager.
Found TwentySeventeen-Child folder.
In it, I created Template-Parts directory.
In it, I created Post director.
When I highlight Post directory and click Edit, I get this message:
“You cannot open this file because it is either a directory or a file larger than one megabyte (1 MB). To edit the file, download it and use a local editor.”
Except there’s nothing inside the directory …
Anonymous User 12851872
(@anonymized-12851872)
Hi,
Move the file content.php directory
/wp-content/themes/twentyseventeen/template-parts/post/
in child theme.
In the child theme, while respecting the path, it is necessary to recreate the folders template-parts and post
To have
/wp-content/themes/childtheme/template-parts/post/
And read this
https://www.thewordcracker.com/en-us/twenty-seventeen-summary-excerpt/