Tagged: custom css
May 19, 2015 at 1:29 pm
I’m trying to add a custom class to the gallery component, specifically so I can customize the image background positioning on the Parallax stacked image option to center top so the tops of the photos don’t get cut off at 100% width. I’ve added the following code to functions.php but it does not appear to be adding the class to the gallery html output. Thank you for your help!
// add gallery custom class
}May 19, 2015 at 3:36 pm
What does your “bernie” class CSS look like?
You will notice that we registered
$stacked_styles = 'background-size:cover;background-position:center center';
(see https://github.com/bearded-avenger/aesop-core/blob/master/public/includes/components/component-gallery.php#L236), for the stacked gallery, so every stacked gallery is a cover image that is center center. My guess is that the filter is not overriding this because it will require a little more logic.
See more on the gallery custom post type here to create an option for center top if you just want that on specific stacked galleries: https://github.com/bearded-avenger/aesop-core/blob/master/admin/includes/components/component-gallery.php.
Here’s what our styles look like for the stacked parallax: https://github.com/bearded-avenger/aesop-core/blob/master/public/assets/less/components/gallery.less.
By the way, it may be helpful to check out our Sample Add-on: https://github.com/AesopInteractive/sample-addon.May 19, 2015 at 3:49 pm
Ny point is not about my specific CSS. It’s that the filter in the code I listed above does not appear to be adding the “bernie” class to any div that surrounds the class in php. I had assumed that the filter would simply add a custom-named class to a surrounding div. Is that incorrect? I was able to target div.aesop-stacked-img and override the position.
May 19, 2015 at 4:18 pm
- This reply was modified 5 years, 8 months ago by Julie Wolpers.
It looks like the filter is missing in the gallery component for ASE core, so we are working on a fix for the filter method.May 19, 2015 at 4:25 pm
Oh, OK, thanks!June 13, 2015 at 4:01 pm
This filter is now in the latest release of ASE! Thanks for the heads up.