Archived topic
Add text to the homepage in a blog
11 replies · Started by Mathieu on February 13, 2020
Hi,
I would like to add a paragraph or two of text on the homepage of my blog. Just before the list of articles.
Is it possible with the Element features or something else? I know I could hook myself but then I would have to go to the code to change it.
Kindest regards,
Hi there,
Is it possible with the Element features or something else?
Yup - you can consider either header element or hook element depending on if you need the options in header element or not:
https://docs.generatepress.com/article/header-element-overview/
https://docs.generatepress.com/article/hooks-element-overview/
Let me know if you need more info :)
Nice it is working. I had to use a custom hook "generate_before_main_content" and it is working on every page but on the homepage it does break the layout.
Broken home : http://nouveauchef.quebecblogue.com/
OK url : http://nouveauchef.quebecblogue.com/category/type-de-recette/
Regards,
Can you clear and disable W3 Total Cache first?
Done. Still the same.
Might be something going on with generate_before_main_content hook and when masonry is used.
Try after_header instead.
Well, I tried after_header and pretty much every other hook but it's not in the blog content zone, it takes the whole page and it overlaps the sidebar.
You're right that it works without masonry but then it is still only on the homepage and the masonry is also on the archives page.
There has to be a way to debug that ;)
Can you copy and paste the HTML content you are adding here?
Please highlight the code and click the code button above.
<h2>
Le livre de recettes faciles du Québec
</h2>
<p>
Bienvenue sur le livre des recettes québécoises du Chef Cuisto,
Ce site de recettes a été conçu dans le but de vous offrir des idées repas simple et rapide à réaliser. Le Chef Cuisto n'a pas la prétention d'être un chef renommé pour sa fine gastronomie, mais il est un chef amateur qui cuisine les recettes du Québec.
</p>
<p>
Mes idées recettes sont majoritairement composé de recettes secrètes des meilleurs restaurants restaurants (St-Hubert, Tim Hortons, Pizza Hut, McDonald’s, etc..), de fast-food, de bacon (Plein de bacon), ainsi que des recettes faciles et rapides de tous les jours.
</p>
Can you try setting the priority to something like 5?
Let me know :)
Oh yeah it works. Thank you.
No problem :)