Archived topic
Parallax Effect in section
13 replies · Started by Chad Biggs on August 19, 2017
Hello, I am using the parallax effect in a section. I enabled the effect and selected the background image. The image I am using is 1171px X 600px and I am using 314px of padding. The problem is that the top of the image is never seen. Just guessing but, I'd say the top 100px of my image does not ever show. I added a custom class and messed with background-position and background-size but I am not having any luck. The outside corner of the kids right eye is the top of the picture.
Here
Thank you,
-Chad
Hi there,
Can you try updating to GP Premium 1.4.3?
Thanks Tom, that helped with the position of the image. The effect is ever so slight, it's hard to tell there is an effect. Is there a way to turn up the speed on the effect? Or is there an image size that works best for this effect?
Thank you,
-Chad
This should help: https://docs.generatepress.com/article/generate_page_header_parallax_speed/
Let me know :)
Firebug says the setting is at 6 but I have it set at 2, so I don't think that filter is working.
How are you adding the filter?
I added it to my child theme function.php file.
Can you show me the exact function you're using?
add_filter( 'generate_page_header_parallax_speed', 'tu_adjust_page_header_parallax' );
function tu_adjust_page_header_parallax() {
return 2;
}
Just tried this, and it worked + reflected it in the HTML:
add_filter( 'generate_page_header_parallax_speed', 'tu_adjust_page_header_parallax' );
function tu_adjust_page_header_parallax() {
return 1;
}
Your child theme file is named functions.php with an s, correct?
yes ... functions.php
Ahh, you're using Sections, not the page header.
In your code, replace this: generate_page_header_parallax_speed
With this: generate_sections_parallax_speed
Perfect! Thank you Tom.
-Chad
You're welcome :)