I didn't cook this snippet up, I found it over here. And I'm reposting it with some tidying up because I know I'm going to be reusing this... Because if you've made use of the Genesis Custom Headers, you may have got frustrated with them too (especially on older themes, I think). This code will Replace a Genesis background header image with an inline one. It helps resolve the issue I was having because of the inability to override styles on a header image because the default code inserts … [Read more...]
Font Awesome Social Icons Menu
https://gist.github.com/thewebprincess/e2609c4e9672ce176af5 … [Read more...]
Conditionally Remove Genesis Footer Widgets
In the latest site build I'm doing I had been asked to conditionally remove genesis' footer widgets from particular pages - in this case from everywhere except the front page. I found a snippet over at Dream Whisper designs that was specific to a site whose front page is their blog page, but mine was a static home page. Here's the code edited to work in that instance. https://gist.github.com/thewebprincess/8347049 … [Read more...]
Add Australian Address Fields to Gravity Forms
This is an updated snippet which has received significant input from Gary Jones, author of the terribly useful book Changes in Genesis 2.0. Don't be too proud to learn from others, people... it makes you a better coder. https://gist.github.com/thewebprincess/8250139 … [Read more...]
Create Custom Post Types in Bulk
I can't tell you where I found this snippet, but it has proven really, really useful. It's a snippet to create custom post types in bulk, simply by adding a couple of variables to an array. If the code is yours, let me know and I'll give you credit for it! I put this code in my functionality plugin which I install on my sites in the mu-plugins folder... that way it's always available regardless of theme. Putting it in the mu file also means that your plugin won't get updated by mistake … [Read more...]
Display the WordPress Template Used
This useful code snippet allows you to display the WordPress template used. It's brilliant for troubleshooting and is also helpful in starting to get your head around WordPress' templating system. By default the snippet outputs to the wp_head hook, however you can add it to any wp hook (or genesis hook available). In the image pictured the url is being output onto our genesis_entry_content hook. https://gist.github.com/thewebprincess/5668762 … [Read more...]
Add HTML to Widget Titles
Sometimes you really just need to be able to turn your widget title into a link. Sounds easy, right? Wrong... By default WordPress strips HTML from widget titles... This sneaky little snippet allows you to shortcut that function and add HTML to widget titles. https://gist.github.com/thewebprincess/6619453 … [Read more...]
Add Class on ACF Repeater Items
I needed to be able to add a class to ACF Repeater Items. I'm slowly learning this PHP malarkey and this code snippet was the result of figuring out a PHP counter and setting it up to count through ACF Repeater group data and add the class only to every third item. https://gist.github.com/thewebprincess/7394736 … [Read more...]