How to Block Facebook for Lent

Today is Ash Wednesday, the first day of Lent for Christians across the world. It is customary to “give up” something during Lent, and many people give up using Facebook.

If you’re like me, it’s hard to forget the muscle memory of typing “facebook.com” into the address bar of my web browser. Because of this, I use use the Windows Hosts File to block my browser (and in fact, the entire OS) from accessing Facebook.

To do this, open Windows Notepad in “Run as Administrator” mode. Open this file (you may need to select “All Files” in the Open dialog box):

C:\Windows\System32\drivers\etc\hosts

At the end of the file, add the following lines to the file:

# Block Facebook
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.connect.facebook.com
127.0.0.1 www.static.ak.connect.facebook.com
127.0.0.1 *.facebook.com

Save the file, and then restart your computer. After a restart, going to Facebook in your browser should not work. This method has an added benefit that Facebook Like Buttons on sites across the internet will not show up, disabling the tracking that Facebook does that is enabled by these buttons.

Twentyeleven Theme Custom Page Template Sidebar Singular CSS Issue

I know that’s a cryptic title.

Frankly this post is mostly for my own future use, and for people who can’t find the answer elsewhere.

If you have created a custom page template based on the “Sidebar Page” Twentyevleven page template, you are likely having layout issues derving from the fact that the “singular” class is getting applied to the body tag of your page when it shouldn’t be. Here’s how to fix that.

Simply add the following code to your functions.php file, replacing the name of your template php file

<?php
add_filter('body_class', 'adjust_body_class', 20, 2);
function adjust_body_class($wp_classes, $extra_classes) {
if (is_page_template('page-name-replace-here.php')) {
foreach($wp_classes as $key => $value) {
if ($value == 'singular') {
unset($wp_classes[$key]);
}
}
}
return array_merge($wp_classes, (array) $extra_classes );
}
?>

Good luck!

New Home St. Louis

I recently moved to St. Louis, MO. More specifically, I moved to University City, one of the hip inner-ring suburbs that was so named for Washington University’s presence in the city.

I’m living near Lewis Park, a nice little park where families go to let their toddlers run around and adults go to enjoy the pond.

I found a cool statue of a fish on a bicycle!

I will post some more St. Louis photography here in the next few weeks/months. If you like the first image by Thomas Hawk, check out many of his cool Arch Photos.