Kevinleary.net, LLC.

Blog

Sensible approaches to build and maintain custom WordPress websites.

Remove The “Posts” Menu From WordPress

I found myself in a scenario today where I needed to remove the “Posts” menu item from the WordPress admin. I worked with this function to do it, so I thought I would share it here. If anyone else out there is looking for a way to remove posts from WordPress, or more specifically the…

Working with Dublin Core Metadata for SEO

The Dublin Core is a relatively up and coming metadata standard that assists with describing a digital document or resource. By providing a set of standard elements that to accurately describe the contents of a webpage, the Dublin Core is a valuable asset for anyone interested in SEO. However, working with the standard is anything…

WordPress Dashicons List

Moved to custom post template.

Find All Functions Attached to WordPress Filter & Action Hooks

Quite often I encounter situations where it’s useful to know what functions are affecting a particular WordPress hook. It really helps me understand the ways that WordPress core, themes and plugins affect my site, specifically through the use of add_action() and add_filter(). This handy function make’s it pretty easy to discover what functions are attached…

Getting a YouTube Video Thumbnail

Grabbing a YouTube video thumbnail is easier than you’d think. YouTube uses a standard naming convention for it’s screenshot images, just replace %VIDEO-ID% with a YouTube video ID in the format below and link directly to the image. https://img.youtube.com/vi/%VIDEO-ID%/0.jpg https://img.youtube.com/vi/%VIDEO-ID%/1.jpg https://img.youtube.com/vi/%VIDEO-ID%/2.jpg https://img.youtube.com/vi/%VIDEO-ID%/3.jpg 0.jpg is full size, while others are scaled thumbnails. There are also other…

How to Hide That Your Site is Using WordPress

I get a lot emails asking how to hide that a site is using WordPress. I thought I would walk through some of the functions I have in my theme to accomplish this. Most of these methods are taken directly from the Roots theme by Ben Ward. If you haven’t already, I highly recommend checking…

Check if an Element Exists with jQuery

Running code only when it is needed is an important aspect of resource management in JavaScript. I use the following method all the time to check if a jQuery element exists before doing something with it. var $selector = $(‘.my-element’); if ( $selector.length > 0 ) { // Do something with $selector } This approach…

Check if a Checkbox is Checked Using jQuery

Using jQuery you can determine if a checkbox has been checked, performing an action based on the result. For example, you may want to conditionally show or hide form fields when a checkbox is selected. The best way to do this is to use is to use is(“:checked”). This combines the is() method with the…

Correctly Redirect a Page in jQuery & JavaScript

Redirecting to another page with JavaScript & jQuery is easy. jQuery is not necessary, instead JavaScript’s built-in window.location object should be used. There are two commonly used approaches, the window.location.replace() method and the window.location.href variable. Understanding the differences between the two is important. HTTP Redirect For a standard redirect, replace() is usually the best approach.…

Testing if a jQuery Object is Hidden

jQuery makes it easy to show, hide or toggle the visibility of a DOM element with the hide(), show() or toggle() methods. It’s often useful to test if an element has been hidden or shown using jQuery. You can easily do this using the is() method to check if an element has a :visible or…

Horizontal Bulleted Lists Using CSS

If you want to create an unordered list in HTML (<ul>) that lists items horizontally while maintaining the bullets this bit of code should help you. This method is more flexible than display: inline, display: inline-block or float: left, allowing you to control the styles used for the bullet. CSS .list-horizontal li { display:inline-block; }…

Font Awesome 4.0 Unicode Icons in Photoshop

Font based icons are hot right now, and lately I find myself using the Font Awesome library all over the place. Today, I wanted to use an icon in Photoshop from the library in Photoshop. Surprisingly, I wasn’t able to easily understand how to use Font Awesome in Photoshop. Luckily, I found a way that’s very easy.

Curated Content on the Web

The indexed web currently contains at least 7.39 billion pages. That’s an insane amount of information to sift through, which is why good web curators are such an indispensable resource. Curators are people who find and share quality sources of information with others. In order to get an idea of what that looks like let’s…

Roots Theme Rewrites & WPEngine

The Roots theme for WordPress is awesome, and so is WPEngine. When using the two together you’ll need to configure nginx rewrite rules to get the Rewrites (clean URLs for static theme assets) feature working properly. WPEngine doesn’t give you access to an nginx.conf file, so you’ll need to use WPEngine’s Redirect Rules feature to…

Prestigious Companies Using WordPress

Over the past few years WordPress has quickly become the most popular publishing system on the web, powering 17% of the internet. Reputable brands have taken notice, and the number of large companies using WordPress to power their empires online is continuously on the rise. This list explores the noteworthy brands that leverage WordPress to…