- This topic has 13 replies, 2 voices, and was last updated 4 years, 6 months ago by
Leo.
-
AuthorPosts
-
March 18, 2021 at 7:57 am #1700566
Elizabeth
Hi amazing GP support team! I’m adding some small animations to my site using wow.js.uk; I was able to add their PHP code snippet to the GP header.php with no problems – and it works great. However, when I try to place the same snippet in my child functions.php (using your official child theme) it won’t work or even save it. It won’t let me add it using the Snippets plugin, either. Here’s the code:
<head>
<link
rel=”stylesheet”
href=”https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css”
/>
</head>Is there something different with the GP Child for this? Please help, thanks!
March 18, 2021 at 8:42 am #1700634Leo
StaffCustomer SupportHi there,
You will need to copy the
header.php
file and put it in your child theme and make the modification there.Let me know if this helps 🙂
March 18, 2021 at 3:47 pm #1701114Elizabeth
Ahh, thanks! And which .php theme file should I copy and add it to if I want the animations to work on the whole home page or other subpages?
March 18, 2021 at 3:49 pm #1701115Leo
StaffCustomer SupportThe
header.php
file as mentioned in the previous reply:
https://github.com/tomusborne/generatepress/blob/master/header.phpJust add that file to your child theme’s folder and make the modification there.
March 19, 2021 at 7:28 am #1701978Elizabeth
Thanks Leo, I did that right away but it’s still only working in the header element. I’ve tried adding the class in the Advanced “Additional CSS class(es)” spot, as well as manually via the “edit as html” and it won’t work in the body section no matter what. So that’s why I was wondering if the “header.php” file is only activating it in the headers of the site. Please advise, thanks!
March 19, 2021 at 4:08 pm #1702396Leo
StaffCustomer SupportI see it working in the header element.
Where else are you using it?
March 19, 2021 at 4:50 pm #1702427Elizabeth
Right now I have it in some of the other home page blocks, but they don’t work. I’d like to be able use it everywhere (home page, some other blocks on subpages.
March 19, 2021 at 5:02 pm #1702435Leo
StaffCustomer SupportI think it might only work for text but I’m not sure.
Sorry it’s a custom script and not something from GP so I’m not really sure how it works.
I can only tell you how to implement the code as you instructed and it’s definitely working as seen in the header element.
You might need to check with the code author to see exactly how the animation works.
March 21, 2021 at 12:14 pm #1704240Elizabeth
Thanks Leo: I know it can work with any html element, I just can’t find which GP theme php file it should be added to so it applies to the whole site and not just the header. Can you enlighten me on that?
March 21, 2021 at 12:31 pm #1704255Leo
StaffCustomer SupportThe header actually exists in every page of the site so the code added there would apply to the entire site.
March 21, 2021 at 4:55 pm #1704393Elizabeth
Ok, but could it be only working in the header element because it’s only pasted in the header.php file?
March 21, 2021 at 6:35 pm #1704432Leo
StaffCustomer SupportAhh I see where the confusion is coming from but no – header and header element are two completely different/unrelated things 🙂
March 22, 2021 at 6:30 pm #1705831Elizabeth
Ok, thanks anyways. I guess I will have to try using a plug in, maybe the Blocks Animation one… 🙁
March 23, 2021 at 8:49 am #1706819Leo
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.