All posts by nerdOne


Disable Comments on WordPress Pages Only

Wordpress Permalink Fix

If you’re like me, you would think that a feature like this would be made very obvious in the WordPress admin interface. In my experience, in the majority of cases, there’s no reason to give your visitors the ability to comment on a normal Page on your site. Posts, sure, but Pages?

Especially when developing a site with a child theme, you may not want to go into the page.php file and just remove or comment out the code related to inserting the comments. But other than that, how do you prevent the display of the ‘Leave a Reply’ comment section on pages. There’s no setting present when you’re on the regular ‘Edit’ screen for a page.

However… there is a simple solution; Quick Edit! If you use the ‘Quick Edit’ mode for pages often you’re likely well aware of this feature. If you go to ‘Quick Edit’ mode for a page you see a handy little checkbox with a label that says “Allow Comments”. There’s your solution. The box is checked by default. All you need to do is uncheck it.


Most of my WordPress sites have a small number of pages but a large number of posts. So, turning off comments only on pages is not a big deal given this little tip.

I’m surprised this feature isn’t more publicized because it’s so simple.


View WordPress Page Drafts in the Dashboard

Wordpress Draft pages on Dashboard

TheDashbaord page of yourWordPress admin interface offers a quick and useful high-level view of your site’s content with the ability to quickly take action as well. There are a number of modules on the dashboard, one of which is the QuickDraft module. Not only does the QuickDraft module allow you to quickly begin a draft of a new post but it also presents you with a list of drafts. For some reason it has been decided that this module should only display drafts of Posts. It would seem to make perfect sense that draft Pages would also be included, but they’re not. However, there is a quick fix for this!

For some reason it has been decided that this module should only display drafts of Posts. It would seem to make perfect sense that draft Pages would also be included, but they’re not. Have no fear, there is a quick fix for this!

To make draft Pages show up in your QuickDraft module on your WordPress Dashboard simply edit the dashboard.php file in your WordPress install. This file can be found here:

> wp-admin > includes > dashboard.php

The line in question is in the function wp_dashboard_recent_drafts. Search for this function and edit the following:

'post_type'      => 'post',

and change it to

'post_type'      => 'any',


That’s it! Now you’ll have your draft pages listed right there on your dashboard for easy access.




Google Analytics Event Tracking for Universal Code

Google AnalyticsYou may not have realized that since Google Analytics made the switch to its Universal Analytics code you event tracking code has to change. The common error resulting from using classic analytics event tracking syntax with the new Universal Analytics code is:

Uncaught ReferenceError: _gaq is not defined

This is because the new code uses ‘ga’ instead of ‘_gaq’.

Also, the syntax of the call has changed. If you don’t update the syntax you may end up with this error:Uncaught syntax error”: Unexpected identifier

Uncaught syntax error”: Unexpected identifier

Here’s an example of what you use with classic analytics:
onClick=”_gaq.push([‘_trackEvent’, ‘Phone’, ‘Click’, ‘Click to Phone’]);”

What you should be using now looks more like this:
onClick=”ga(‘send’, ‘event’, ‘Phone’, ‘Click’, ‘Click to Phone’);”

Passwordless SSH Login between OS X and Remote Server

terminal-iconIf you commonly ssh from your OS X computer to a remote server such as a web server it makes sense to set up passwordless ssh login so you can have a secure connection without having to always enter your password. Setting up passwordless login also allows you to run automated scripts to help with managing things like offsite backups. Scripts can’t be automated if they require someone to be present at your machine typing in passwords every time they run.

It’s worth noting that you may first want to check if you already have existing ssh keys on your computer. This can be done by entering cd ~/.ssh [enter] at your terminal. If you get a response back stating “No such file or directory” then you need to proceed with the following steps.

To set up passwordless login between a remote unix/linux server and your OS X machine fire up terminal and…

1. generate an RSA private key

ssh-keygen -t rsa -C “”

2. copy the key to your clipboard

pbcopy < ~/.ssh/

3. ssh into the webserver

ssh (login with your password for the last time)

4. make a .ssh directory, if it doesn’t already exist

mkdir .ssh

5. create an authorized_keys file and paste in the key from mac that you just copied to your clipboard

vi .ssh/authorized_keys (paste in key from clipboard, save)

6. set permissions for necessary files and directories on webserver

chmod go-w ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

That’s all there is to it. These steps could all be combined into a single line but the above is much easier to follow.

Resolving ‘Bad Request Error 400’ in Gmail on Chrome

Gmail on Chrome: Bad Request Error 400
Gmail on Chrome: How to resolve the Bad Request Error 400

I periodically come across the “Bad Request Error 400” problem when using Gmail on Google Chrome. I’m not the only one as you can see from a Google search on the topic. One minute all is well and the next, reload after reload all you see is a blank page and this error message. You haven’t changed anything but things just don’t work anymore. If you try accessing Gmail on a different browser like Firefox, everything seems good, so it’s not Gmail itself; it’s the combination of Gmail and Chrome.

It seems quite ridiculous really that this issue should happen on Chrome. Shouldn’t Gmail on Chrome be essentially bulletproof? Google on Google. C’mon.

When looking for answers the most common suggestion you’ll find is to clear all of your browsing data; history, cache, cookies, etc. I happen to like my browsing data. Among other things, it helps me find things and allows me to stay logged in on various sites. Deleting it all causes me pain.

After searching through various sites and the Gmail and Chrome forums I finally found a great solution. It turns out deleting all of your browsing data is not necessary. This problem comes down to one solitary cookie. Delete this cookie and life is good again.

How to resolve the Bad Request Error 400 in Gmail

Here are the exact instructions.

– Right click on the page with the error
– Select “Inspect Element” from the right click menu
– Select the “Resources” tab at the top of the Developer Tools pane or window that opens up
– Expand the “Cookies” section on the left side navigation by clicking on the little triangle next to “Cookies”
– Select the “” cookie
– Right click on “GMAIL_IMP”
– Select “Delete”
– Refresh the error page

– Rejoice

Original source of solution




Mac OSX Lion Cursor Disappeared? Get It Back

Mac OSX Cursor Gone
Did Lion devour my cursor?

From what I’ve found when searching online, I’m not the only one who has their cursor periodically disappear in OSX Lion. Once in a while I’ll return to my Mac Mini (my iMac and Macbook Pro never have this problem) and my cursor is nowhere to be found. The mouse or trackpad still works; if you go way down on the screen over the dock the hover affect will work but the cursor is still not visible.

Zoom the Screen

One way I found to bring the cursor back is to zoom the screen. If you don’t already know this, you can zoom in the screen at any time by holding down the ctrl key and scrolling up (or down depending on your system preferences). You can then zoom back to normal again by doing the opposite and, voila! Your cursor is back.

I can’t guarantee that this will work for you but it definitely works for me and I’ve heard from many others who say the same. Hopefully this tip will help you end the frustration of the missing Lion cursor.

If you have another solution to this issue, please do let me know in the comments. I’m sure others would love to hear about it too. The above solution works but it still annoying.

Fix For PayPal CSV Transaction History Download

PayPal Issues
PayPal Issues Solved

Have you been frustrated with trying to download your PayPal transaction history only to have the browser spin it’s wheels forever. Even if your report is small, the download still usually fails. I’ve fought with this many times and have finally found the fix. Apparently this is due to a PayPal timeout issue. You can fix this problem by using a terminal command to “aggressively try and keep the connection to PayPal alive” so the download can finish.

So, to fix this on a Mac,:

  • go to your History page on PayPal
  • select your date range
  • open Terminal or iTerm
  • enter the following
    • sudo sysctl -w net.inet.tcp.keepidle=10000 net.inet.tcp.keepintvl=5000 net.inet.tcp.always_keepalive=­1
  • enter your admin password
  • successfully download your transactions!

If your transaction list is huge you may still have to narrow your history search.

Thanks to Mark for posting this solution. I found it here:

What Happened to File Paths in Lion’s Spotlight Results?

Spotlight in Lion

Being a nerd I love keyboard shortcuts. Because of this, when using a Mac I use Spotlight extensively. I use Spotlight as a calculator, for word definitions, and most frequently, to launch applications and find files.

One of the many changes in OS X Lion is a change in Spotlight is that it no longer displays the path to a file on your machine when you mouseover a search result. Previously I used this all the time when trying to locate files. How could Apple get ride of this extremely useful feature?

Well, they didn’t. It’s still available but is a bit more hidden. I’m not sure where this is documented or how we were supposed to figure it out but thanks to Richard Cardona and the CapMac Forums I learned how to get file paths again. Now I’ll share it with you.

  1. As before, enter your search query in Spotlight.
  2. Also as before, either use your arrow keys to move down to the appropriate search result or mouseover the search result
  3. When the new preview window pops up to the left of the Spotlight results, hold down the command key

At the bottom of the preview window the name of the file will initially be displayed. Keep holding down the command key and in a second or two the path of the file will be revealed! Now you know where that file is located on your system.

Lion Spotlight Search Results with File Path
While holding down the Command button

Changing Where PayPal IPN Emails Payment Notifications

PayPal IPN
PayPal IPN Email

If you use PayPal for receiving payments online you are likely using PayPal Instant Payment Notification (IPN) as well. This is very useful as it results in an email being sent to the email address you specify whenever a payment is received via PayPal.

However, the email address that you receive these payment notifications at is not necessarily the email address you have configured within your PayPal account for receiving notifications. To set or change the email address to which these IPNs are sent you need to modify the code in the file you point to in the hidden ‘notify_url’ that you set in the form you use for posting to PayPal.

e.g. if you’re using PHP  the field might look like:

<input type=”hidden” name=”notify_url” value=””>

In the above case, paypal_ipn.php is the file that gets called after payment has been made. Within this file is the code that send the actual notification email. To set the email address that will receive the payment notification you change the $from variable.

Note that if you want to change where the actual receipt from PayPal gets sent you need to change your primary business email address and then update this in the hidden ‘business’ field in the form you use to post to PayPal.

Apples to Apple: Fun and Interesting Infographic

Here’s a fun infographic comparing Apple, the company to apples, the fruit.

A few of my favorite points:

  • China produces 44% of the world’s apples and 100% of the world’s Apples
  • the average apple weighs about the same as an Apple iPhone 4s (5oz. versus 4.9oz.)
  • an iphone 4s is 33.6% glass

Thanks to MBA Online for putting this one together.

Apples to Apple: more similar than you might think
Apples to Apple: more similar than you might think