Development and Wordpress Tutorials

View All Event Listeners

Ever had some sort of conflict on an event listener? Or just want to see what else is being executed on the same action on page. Depending on your browser, this may or may not be a built in functionality. Built-in to Browser In Google Chrome, right click on the page, go to Inspect Element.

Continue Reading →

Close Div or Menu On Click Outside w/ Javascript

If you’ve ever dealt with menus that open on click, but want them to close when a user clicks outside the menu area, here’s a pretty simple way to do it. I add an event listener to the document’s body.  When someone clicks it, we look for the event’s target id.  If it matches the

Continue Reading →

Securing WP-admin Directory in WordPress

In an ideal world, it would be easy to change the wp-admin folder name. While that’s not really possible without some hacking of WordPress, there are a variety of things you can do to secure wp-admin a little bit more. I’m not going to get into trying to rename this folder, as until there is

Continue Reading →

Clear DNS Cache in Google Chrome

Sometimes I’ll do an update to some DNS setting, change the hosts file, something along those lines, and my DNS cache needs clearing for Chrome. Typically I would just restart the browser, but that can be annoying if you have a lot of windows open. I found a couple of ways to do this though

Continue Reading →

Password Protect Directory with .htaccess

Ever wanted to lock down a directory behind a simple user/password system? If your web server is run with Apache, you can password protect a directory quite easily with your .htaccess file. .htaccess AuthType Basic AuthName “Password Protected” AuthUserFile /var/www/.htpasswd require valid-user The important part to note above is AuthUserFile /var/www/.htpasswd. That provides the path

Continue Reading →

Set Facebook Share Image Thumbnail in WordPress

When someone shares an image from your WordPress blog to Facebook, they usually do a pretty good job of guessing which image is the right image to turn into a thumbnail, but did you know you can set the image so Facebook doesn’t have to guess? In header.php before the closing head tag, add the

Continue Reading →

WP_Query vs query_posts vs get_posts vs pre_get_posts

Quick Breakdown query_posts – don’t use except in rare edge cases pre_get_posts – use if you want to alter the default query on a page new WP_Query – use to get different results from the main query get_posts – same as WP_Query, just returns results in array format instead query_posts Using query_posts is not recommended

Continue Reading →

How to Check Date of Photo iPhone

I wanted to check the date of a photo I’d taken a while back, but as it turns out, there is no way to check this information built in to your iPhone. There are a number of paid apps out there that will do this if you already have one, like iPhoto. If you don’t

Continue Reading →

Set a Song as a Ringtone on your iPhone

This should work for creating a ringtone for both iPhone 4, iPhone 4S, and iPhone 5. There are special programs and such out there for this, but they are pretty unnecessary as it is a fairly easy process. Open up iTunes and browse to your music section. Select the song that you want to turn

Continue Reading →

Displaying Charts with Titanium Appcelerator

The ti.charts module that you can find in the Appcelerator marketplace is for iOS only. I wanted a lightweight solution that could function on both Android and iOS and provide the most common of charts, bar, line, pie, etc. The simplest way to go about this was for me to use a charting javascript library

Continue Reading →