On a WordPress project, I wanted to display the full post on the blog archive unless a manual excerpt had been created for the post (in which case I wanted to use the manual excerpt). Here is the code I used to make this happen.
On a recent project, I had to trigger a certain behavior when a native HTML5 video had completed playing (i.e. reached the end of the video, manually stopping it should not trigger the behavior).
I’m a big fan of the Gravity Forms Form builder WordPress plugin. I came across an interesting issue on a project where I was using the default value functionality and I wanted to make some notes as a warning for others (and myself) in the future.
When working with a WordPress image, I wanted the attributes for the image. The function `wp_get_attachment_image()` provides me everything I need but in a rendered HTML string, rather than a more useful array of attributes. I was surprised I was unable to locate a good way to get this information, so I wrote this code to help me.
I like to use the Scriptless Social Sharing WordPress plugin to add Share buttons to my blog posts. Recently I had a client notice that because the Email Share button has target=”_blank” in the HTML markup, it opens a new tab when clicked. This is great behavior if you’re using web based email (e.g. Gmail), however if you’re using an email application on your computer, you end up with a blank tab. This code removes target blank from the email share link.
I’ve been using Local by Flywheel for my local WordPress development and I wanted to use Xdebug with Visual Code Studio with it. These are the notes I’ve made for myself in case I need to set this up again in the future.
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.