Archived topic
Archive Category Pages Displaying Entire Post on Video Post Type
3 replies · Started by Morgan on February 27, 2023
This one has been bugging me for a while...
For some reason, my category/archive pages are working fine with any post type=standard with a small pic, headline and excerpt. But any post with type = video, is trying to display the ENTIRE ARTICLE instead of the excerpt like the standard post types do.
Link Here:
https://www.thesmokies.com/category/sevierville/
For visual reference, I want all posts to look like this:
https://media.thesmokies.com/2023/02/Standarad.png
And NOT this:
https://media.thesmokies.com/2023/02/Video.png
Hi there,
so a video post format, doesn't generate an excerpt by default, as it relies on displaying the Content with its HTML intact so as the Video embed can be displayed.
You can tell GP to load an excerpt using this PHP Snippet:
add_filter( 'generate_show_excerpt', function( $show ) {
if ( 'video' === get_post_format() ) {
return true;
}
return $show;
} );
But this will treat it like any other post ie. a featured image and excerpt. Not a video thats within the content.
Does that work for you ? Or must the archive show the video embed before the excerpt ? ( as thats a lot more tricky )
Worked PERFECTLY thank you again David
You're welcome!