When working on a project, using Gravity Forms and Bootstrap, I wanted to style the buttons with Bootstrap. This code allows me to modify the markup output by the Gravity Forms WordPress plugin to use the Bootstrap classes.
By default the Wordpress Genesis theme framework loads the jQuery Superfish Menu Plugin to help the menu display properly. If you’re displaying your menu in a way that doesn’t need Superfish, you can remove it with the following code.
I often find it helpful to add a label to the Featured Image area in the WordPress admin. By guiding clients to upload the appropriate sized image, it lets me avoid them being surprised by WordPress cropping their image in an unexpected way.
It is common for articles on writing WordPress code to refer to adding the code to the functions.php file in the active theme. This is one location where code can be added but it isn’t always the best. Places to Add WordPress Code a new file in wp-content/mu-plugins a new plugin in wp-content/plugins the functions.php […]
With the prevalence of large monitors, I’ve found I wanted a larger container size than the default in Bootstrap 4, which is 1140px. Fortunately, working with the Bootstrap 4 Sass code it only takes a few lines of code to add an additional container size (and breakpoint to go with it).
Images that appear wider than the text around them are a cool design technique. I do a lot of work with Bootstrap and unfortunately, I’ve found that getting this to work usually ends up with markup that leaves me unsatisfied – at least until now. Using this technique, we can get a full width image without first closing the container element.
WordPress comes with some helper functions for finding a theme’s path and/or URI, which are tremendously useful but I always have to look them up. Therefore, I’m making note of them here so I know where to look them up: get_stylesheet_directory(), get_stylesheet_directory_uri(), get_template_directory(), get_template_directory_uri()
I’ve been using PHP CodeSniffer to help me following coding standards. The WordPress Coding Standards are a great resource and the basis of the rules I follow. I have made a few modifications based on my personal preferences.
When it comes to adding social sharing buttons (e.g. “Share on Facebook”), I’m a big fan of Scriptless Social Sharing by Robin Cornett. The one thing I like to do when using it is add UTM parameters to the links that are shared. Here is the snippet I use to add UTM parameters to my URLs that are being shared.