Archived topic
.post__lead
6 replies · Started by francesco on December 19, 2021
Some blogs / sites have a subtitle. this subtitle also appears at the top of the image on the home page if you hover over it. what should i use a css? plugin?
Analyzing these sites I see that the wording is post__lead.
Hi there,
The approach on how to do this will depend on the content of the subtitle.
Is the subtitle dynamically changing for each post?
If yes, we'll have to set a way for the posts to have a subtitle field. We then fetch that value and hook it above the featured image through the generate_featured_image_output filter.
If it's going to be the same for all posts, then you can hook in a simple text on generate_after_entry_header or generate_featured_image_output.
But I may be missing what you mean completely. Can you provide a mockup image or link us to a reference site you're trying to replicate? To have a context. :D
Generatepress doesn't have the subtitle function? i need a plugin for this?
Hi there,
no GeneratePress doesn't add subtitle function. You can use this plugin to add the Subtitle field in the post editor:
https://en-gb.wordpress.org/plugins/kia-subtitle/
Then you can display the SubTitle using a Hook Element using this PHP Snippet:
<?php the_subtitle(); ?>
or use the Shortcode it provides in a Block Element:
[the-subtitle]
https
Are Excerpt in wordpress/gutenberg and subtitle the same thing?
Are Excerpt in wordpress/gutenberg and subtitle the same thing?
Not sure if I fully understand but yes the excerpt function is handled by WordPress core:
https://developer.wordpress.org/reference/functions/the_excerpt/