Archived topic
How to add some html formated text to every new post in WordPress
1 reply · Started by Ogi22 on January 15, 2021
I create posts in which similar text is repeated to me.
Therefore, I would like to make my work easier, and therefore I want every new post to already contain this text.
Example:
Each posts contains the following headings, under which the text that is specific to each post will proceed.
<h2> Keywords </h2>
<h2> Similar articles </h2>
Where should I insert the predefined text to be included in each new post?
I'm looking for a solution for new posts, not new pages.
But it would be interesting to see a solution for new pages as well.
I use GeneratePress V 2.4.2
## My research
I should probably edit the single.php file, but I didn't find where to insert the text.
Hi there,
not as simple as that - as the single.php does not alter the_content you can only add elements inside the template with that method.
Creating block templates for your post is not that simple, really good guide on that here:
https://www.billerickson.net/gutenberg-block-templates/
Alternative is to create a new post with your headings etc. and use the Duplicate Posts plugin each time you need to create a new post.