Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customizing CSS on native/builtin WP Gallery – Genesis Hook available?
Tagged: customize css, media, native gallery, wp gallery
- This topic has 2 replies, 2 voices, and was last updated 9 years, 8 months ago by ceohq.
-
AuthorPosts
-
July 14, 2014 at 2:13 pm #114294ceohqMember
I am hoping someone here may know the answer to this or if there is a Genesis Hook or other Genesis plugin or tool that may solve this mystery.
I am using Genesis + Lifestyle Pro. I am trying to customize the CSS for the native/built-in wordpress gallery. I'd like to simpy change the borders/color of hyperlink around the images type stuff for galleries generated through the media area. From all of my hunting, It seems that the CSS pulls from the core wordpress files and the only way to alter it is to add this line of code to your theme functions.php file:
add_filter( 'use_default_gallery_style', '__return_false' );
I have done that, but, it then essentially turns off ALL of the code, not just the styling around the image, for the functionality of the entire gallery. I cannot seem to find the code for the ENTIRE functionality of the gallery to even cut and paste it back into my child theme functions.php or style.css to then customize it directly.
Is anyone aware of a hook or other genesis tool that allows you to customize the wp gallery css without having to alter or fully override the core wp code directly? I do need to use the native WP gallery (due to anther plugin that autoimports data for me which is added to the media area -- most gallery plugins seem to create their own databases and not use the core media area).
Or, if you know what code I'd cut and paste from the core WP files into the functions.php or style.css files to customize I'd go for that as well.
Ultimately I am trying to get all of the images on my site to "match" or at least have some cohesiveness, as they are pulled in /displayed by a couple of different sources. The native wp gallery has a horrible grey border it adds to everything to show its a hyperlink. I'd even go for just removing that.
Here is a link to my site if it helps you to see the issue. (the top images come from one plugin (i do like the styling on them) and the bottom set of images are generated through the native WP gallery.
http://organizeme.com/06/skylanders-storage-to-the-rescue/
http://organizeme.com/06/skylanders-storage-to-the-rescue/July 14, 2014 at 2:48 pm #114297Brad DaltonParticipant#gallery-2 img { border: 2px solid #cfcfcf; }
There's the class.
You could take the styles from the 1st gallery and use them on the native gallery.
July 14, 2014 at 3:16 pm #114300ceohqMemberThanks for chiming in Brad! I have actually been reading a lot of material from your site ironically including this article:
http://wpsites.net/web-design/customize-native-wp-gallery-images-displaying-in-theme-locations/
It seems that the #gallery-2 will change with each gallery added ( -3, -4, etc) so the styling needs to be applied to "all" galleries generated since i want the same look and feel to be throughout the entire site.
Me, and several friends I've even tried to pick the brains of, have tried adding the code you noted above, and similar type code mentioned in the article on your site, in the style sheet and wp does not recognize it until you add the code below to the child theme functions.php:
add_filter( ‘use_default_gallery_style’, ‘__return_false’ );
Once you do that, you can create css code, but the above line also then eliminates all of the formating that affects picking # of columns, etc when all I want to do is change the hyperlink and borders type stuff, not essentially rewrite the entire gallery coding.
I even tried following this tutorial below. The guy seems to be on the right track, but there still seems to be some core coding missing as all column formatting disappears and just streams everything into one long single column. One site warned against doing this much moving of the core wp functionality to the child theme, as it would then impact any plugin that works with galleries potentially.
http://theme.fm/2011/06/how-to-style-your-wordpress-gallery-43/ (See section on Using CSS to style your galleries)
I've spent a few hours every day for weeks trying to get this to work and it just seems it really shouldn't be this hard 🙂
Apparently though, a lot of other people have had the same issue as i've found lots of people trying to do something similar. And nothing, at least to my level of understanding, seems to work 100% or has enough additional details that I know what I need to add for my specific site.
If you have any ideas, please let me know, or if you recognize what may be missing from the theme.fm tutorial it may just be a few lines or something that need to be added. One challenge seems to be that galleries has evolved over the last few years in WP core so tutorials are not necessarily matching the lastest version of WP.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.