- This topic has 6 replies, 3 voices, and was last updated 5 months, 1 week ago by
Andres.
-
AuthorPosts
-
August 15, 2020 at 12:43 pm #1404359
Andres
Hello,
Could you please help me add HTML in GP Pro?
I see there are 2 options: 1. Elements > Hooks, but this requires adding a function to enable PHP execution in Hooks if it’s disabled in wp-config.php, which permits PHP execution in Hooks, and 2. Adding the HTML directly to the child theme?
If I don’t want to allow PHP execution at all in Elements/Hooks, then Option 2 is the only viable one, right? If that’s the case, could you please explain how to add HTML to a child theme and use the hook: generate_after_archive_description so the filter appears just above the posts list?
The HTML below is to add filtering functionality to a custom category php template that’s using WPSP for the posts feed. Below is the HTML to add, for reference.
<span class="scf_tags_group" style="color: #3a3a3a;"> <a class="scf_tag_button preselected" data-val="All" style="color: #000000;">ALL</a> <a class="scf_tag_button" data-val="Engagements" style="color: #000000;">ENGAGEMENTS</a> <a class="scf_tag_button" data-val="Weddings" style="color: #000000;">WEDDINGS</a> </span>
Thank you, and have a good day!
August 15, 2020 at 7:04 pm #1404509David
StaffCustomer SupportHi there,
try this:
add_action( 'generate_after_archive_description', function() { echo '<span class="scf_tags_group" style="color: #3a3a3a;"> <a class="scf_tag_button preselected" data-val="All" style="color: #000000;">ALL</a> <a class="scf_tag_button" data-val="Engagements" style="color: #000000;">ENGAGEMENTS</a> <a class="scf_tag_button" data-val="Weddings" style="color: #000000;">WEDDINGS</a> </span>'; });
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 16, 2020 at 10:40 am #1405283Andres
Hello David,
Thank you for the help.
One question. Where do I add that code? Does it go in the functions.php file in the child theme?
Have a good day.
Andrés
August 16, 2020 at 1:02 pm #1405383Tom
Lead DeveloperLead DeveloperHi there,
Any one of these methods will work: https://docs.generatepress.com/article/adding-php/
Your child theme functions.php file is perfect 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 18, 2020 at 12:54 pm #1408323Andres
Thank you, Tom!
Have a good one.
Andrés
August 18, 2020 at 1:10 pm #1408360Tom
Lead DeveloperLead DeveloperNo problem! You too 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 18, 2020 at 1:13 pm #1408364Andres
Hi Tom,
I’ll keep you updated on how the implementation of a third-party filter for posts shows in WPSP goes. That’s what the code in this thread is for. It’s a work in progress.
Thank you very much for all your help!
Cheers
-
AuthorPosts
- You must be logged in to reply to this topic.