- This topic has 11 replies, 3 voices, and was last updated 3 years, 4 months ago by
Leo.
-
AuthorPosts
-
December 16, 2022 at 5:41 pm #2464699
Trish
Hi,
I’ve tried adding a hook but am not sure how to get that hook to appear on the posts.
Here’s an image showing you the hook I created: https://www.awesomescreenshot.com/image/35427316?key=c82f9ddfdbfe91c7e4d70f0adb0e43c7
Also want to be able to customize the date line (for lack of the proper title). Again, that is explained best in my image here: https://www.awesomescreenshot.com/image/35427263?key=e9d74327ca7da621626ffa3a0f3a7b24
Thank you in advance,
TrishDecember 17, 2022 at 5:26 am #2465000David
StaffCustomer SupportHi there,
for reference you can see the visual hook guide here.
1. Add a new Hook.
2. Select thegenerate_before_entry_titlehook.
3. In the text area just add the HTML you want to display – you don’t require the PHP function or add action.
4. Set the Display Rules accordingly.See if you can get that working and then we’ll look at the date meta requirements.
December 17, 2022 at 9:39 am #2465291Trish
Hmmmm, there is no suggestion offered here: https://docs.generatepress.com/collection/hooks/ for that hook 🙁
So… tried this: https://www.awesomescreenshot.com/image/35436419?key=f43b7f748b463f20bc2d18a6b7d6ce42 but that is a disaster. LOL!
Even tried changing “_above_” to “_before_” in the function call but that made NO change.
December 17, 2022 at 12:16 pm #2465412Leo
StaffCustomer SupportIt doesn’t look like you’ve followed David’s suggestions 2-4.
This is all you need to do:
https://www.screencast.com/t/kXXRnZcyKYV
https://www.screencast.com/t/xoBBIGgKNiDecember 17, 2022 at 3:14 pm #2465498Trish
Thank YOU Leo, for the correction… and that part is now completed… WOW!
I searched online like CRAZY trying discover how to add hooks to GP premium. I had NO idea they were THIS easy to add.
So… now my questions to complete this will be:
1.) how to center the text,
2.) change the color used to display the text, and
3.) make the text appear smaller than 20px.December 17, 2022 at 3:15 pm #2465501Leo
StaffCustomer SupportAre you using the block editor?
It would be much easier if you are.
December 17, 2022 at 3:17 pm #2465502Trish
Yes Leo, I am… but when I open the post in edit view, I cannot see that block.
December 17, 2022 at 3:27 pm #2465506Leo
StaffCustomer SupportIn that case, remove the current Hook element and add a Block Element Hook instead:
https://docs.generatepress.com/article/block-element-hook/Then simply add a GB’s headline block:
https://docs.generateblocks.com/article/headline-overview/Then you can use the options to do the three things requested:
https://docs.generateblocks.com/article/headline-overview/#alignment
https://docs.generateblocks.com/article/headline-overview/#typography
https://docs.generateblocks.com/article/headline-overview/#colorsDecember 17, 2022 at 3:31 pm #2465508Trish
Okay… now I REALLY feel stupid. Where do I find the Block Element Hook to use, instead of the Hook Element? 🙁
December 17, 2022 at 4:08 pm #2465538Leo
StaffCustomer SupportThis should help:
https://www.screencast.com/t/2gbk4rwIaDecember 17, 2022 at 4:43 pm #2465558Trish
Thank YOU, Leo!
Now I’ve got it.
December 18, 2022 at 12:19 pm #2466237Leo
StaffCustomer SupportNo problem 🙂
I’ll mark this topic resolved and please open a new topic for the new question.
-
AuthorPosts
- You must be logged in to reply to this topic.