Mostly Harmless

Mostly about my amusement

Archives (page 27 of 97)

Use WordPress child themes

Before WordPress 3.0 the default Kubrick theme was called, um, “Default”. In the support forums people would update to the latest and greatest WordPress version and become shocked when their edits to the Default theme were lost.

It’s part of the WordPress distribution. When you override the WordPress files, those get included as well. Now with 3.0 the Default theme is gone and replaced with Twenty Ten. People will still make the mistake and modify the theme directly.

It’s not necessary and by creating a few simple file and directories, using a child them on your own is easy.

I’m a fan of the Hybrid theme and have been using a child theme already. The Vigilance theme caught my eye and I thought I’d give it a try. It was even easier when I located their instructions on how to start off.

1. Start with a pristine copy

I downloaded a copy of Vigilance from the Theme Foundry website and extracted it to my wp-content/themes directory. The version on their website is 1.51 which is slightly more up to date than the version on WordPress.ORG’s site.

2. Create your child theme directory

In wp-content/themes I create a directory called mostlyharmless-vigilance and extracted the files from this zip file into it. This is outlined in The Theme Foundry’s instructions.

3. Modify the CSS on the child theme

In the child theme directory I modified the style.css and added  a few lines:

.center-ad { text-align: center; margin:10px 0 10px 0; }
ul li.widget ul li a {
 display: inline;
 padding: 0;
 background: none;
}
embed {
 background: #fff;
 border: 2px solid #eee;
 }
#wrapper {
 background-color: white;
 border: 1px solid #ccc;
 padding: 15px;
 margin: 25px;
 margin-left: auto;
 margin-right: auto;
 border-radius: 10px;
 -webkit-border-radius: 10px;
 -moz-border-radius: 10px;
}
body {
 background-color: #ecf1ef;
}

This was to do provide me a CSS class to

  1. Provide a class to center my 2 ads
  2. Modify how the sidebar links look
  3. Put a border around and embedded videos
  4. Mess with the wrapper ID
  5. And change the color of the body background.

Nothing dramatic and the rounded corners are very 2004.

4. Modify the child theme’s functions.php file

My child theme has one useful line in it like so


php
$GLOBALS['content_width'] = $content_width = 600;
?>

I use oembed to insert YouTube and Vimeo videos into my posts. By adding this line, the embeds become 600px wide when the content supports that.

5. Start modifying files (if you want to)

The Vigilance theme will display that posts featured image if it exists. I comment out that line in index.php to disable the from happening. I copied index.php from wp-content/vigilance into wp-content/mostlyharmless-vigilance and edited line 15

<div class="entry clear">
<?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail( array(250,9999), array( 'class' => 'alignleft' ) ); ?>

and commented out the if function.

<div class="entry clear">
<?php // if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail( array(250,9999), array( 'class' => 'alignleft' ) ); ?>

Next I copied the header.php file into my child directory and modified the second line DOCTYPE from strict to transitional. Some plugins I use look better in transiti0nal.

Last, I made a copyof single.php and modified it to insert my second ad.

6. Upgrades wont worry me now

The whole point of this exercise was to make changes to the Vigilance theme while not touching the Vigilance theme’s files. When an update to the parent theme comes out, I won’t have to worry about what I’ve changed.  The three files I have modified are easily determined and simple for me to support.

If you only want change the CSS, then it’s even less work and you can skip step #5.

SNIPER: Ghost Warrior

I now have a game to replace the sniper FPS that I play the most.

The FPS Sniper Elite is one of my favorite all time PC video games. As a World War II American OSS sniper, you crawl around parts of Germany and execute missions.  These missions need to be performed covertly and mostly in silence. Unless you got them into a long killing field, simple numerical superiority meant that if a squad of Germans or Russians rushed you (the sniper) then you died.

It even had a follow the bullet camera mode for those really good shots, complete with a range indicator.

The game was great but it was obviously designed for an original XBox in 2005. The graphics are dated and the AI is repetitive. I’ve played it so often that I manage to quickly wipe out the enemies and accomplish the mission.

My buddy and fellow Sniper Elite fan recommend that I get SNIPER: Ghost Warrior. A quick visit to steam and the game was purchased and installed in no time.

It’s got everything I like about Sniper Elite but it’s a 2010 game taking place in South America. The graphics, sound, and missions are great fun. When you die you get to replay the mission and target the bad guys that you missed.

Here’s a scenario I just did.  To get to a light house I tried to crawl and make my way to my destination without engaging any enemy troops. After getting shot up and compromising the mission, I realized that troops were paired into 3 groups and I could kill them off without alerting anyone. Once I got to the lighthouse I was able to wrap up the mission.

I’ve only played it for  about 2 hours but I really like the game and should have it wrapped up in a couple of days.

Cue the vacation music

Lily and I started our vacation Friday night by eating at the Bhatti Indian Grill and enjoying really good spicy food. It was also our wedding anniversary and unlike last year neither of us forgot it. 16 years plus 5 years dating! She’s perfect.

We have very different vacation styles.  She likes to fill up each day with activity to maximize the time we have. You know, go places, do things, etc. I used to joke that vacations with her was like a military campaign and sometimes it was. I always had a great time with her but the pace was a little intimidating.

There is nothing wrong with that kind of planning. But I get deadlines and furious activity on a daily basis at work. NOTE: THIS IS NOT A WORK DIG! But when you work in a certain industry you deal with fire drills all the time. It comes with the job and I’m fine with that.

How do I prefer my vacations? I like to just take it easy and relax. Go places (or not), run around (or not), and accomplish thing you set out to do (or not). My goal for this week is to relax with Lily and the kids.

I would like to accomplish the following things.

  1. Spend quality time with the wife and kids. Quality time? Can’t believe I’m using that phrase, but what that means is “Don’t sweat the small things”. You know, take it easy with family.
  2. Start and maybe complete another Bandai MG model. I’ve got the MG Gouf v2 all lined up (Lily won’t let me order more unless I make my unassembled model stash smaller!)
  3. Take more pictures. I like my amateur photo hobby and really am jonesing for a 24-70mm  f/2.8 Nikon lens.
  4. Do something with my WordPress theme! The latest not-really-a-GPL-argument-just-copyright-infringement has gotten me to examine how my blog looks. If only I had the time to learn CSS, that’s what really sets one site apart from another.

The last item on my list is to have fun and relax. The list is incidental as long as I have a good time. Mostly I’ll just cheerfully go with what the family does.

By the way, my vacation theme music? It would have to be this song.

No iPhone 4 for me yet?

Not really news, but nice to see that Consumer Reports can send people the straight scoop.

This seems to put to rest the myth of this being a software glitch. I still plan on getting one. I was going to get the bumper anyways and it’s still an awesome phone despite the antenna flaw.

And now an iMac

I have way too many PCs in my house, but a couple of them have been elevated to “must have”. The notebook in the kitchen had become indispensable, like coffee in the morning.

My morning wake up routine became

  1. Drink coffee
  2. Check my e-mail
  3. Check out my social networks
  4. Do a little sysadmin on my servers
  5. Drink some more coffee

And all from my kitchen notebook. But the HP notebook was overheating and automatically shutting down on a routine basis. As a result Lily and I thought “why not replace it with a Mac book?”

Once we got to the Apple store we realized that the iMac was more bang for the buck, and the small kitchen notebook never moved from its place. We now have the 21.5 inch iMac cheerfully sitting on my kitchen island and I’m writing this up on it now.

We selected an iMac because the kids use them in school and more importantly, I just want the thing to work. It’s pretty straight forward and after I ran the software updater a few times I was up to date on all the patches.

It’s got a Bluetooth mouse and keyboard. The mouse was easy to get used to (it’s a Magic Mouse after all) but the keyboard makes me do an occasional double-take. There are no insert or page down/up keys and while the chiclet keys are not small, the overall size of the keyboard is.

Adding my network printer to the iMac was a breeze. Once it found the printer on the network, all I had to do was confirm that I wanted to install it.

Overall I’m really pleased with it. Everyone likes the iMac and the display looks great. The only thing that I’ll need to do is find the equivalent versions of the software I use. I’m mostly a Notepad++, PuTTY, and Firefox user so I should be able to find Mac equivalents.

Alice in Wonderland (not in 3D)

Last night I sat through Alice in Wonderland with my daughter and got to see Johnny Depp, Anne Hathaway, and company in a Tim Burton epic. We watched it on DVD.

I had low expectations but was surprised when I really liked it. The story starts off in usual visual Tim Burton fashion and grows from there on. Alice ends up in the Rabbit Hole and by the end of the movie it’s all connected and works out.

What I can’t get is how would this, or most movies, benefit from being in 3D? When I saw Pocahontas Avatar on Blu-Ray, I liked it. I could easily see how the movie was shot and generated for 3D, but the predictable story line played out well.

I’m not criticizing Avatar; who doesn’t like it when the hero beats the bad guy and gets the girl? James Cameron really knew what he was doing. He had a vision to show and kept with it. Everyone I know who saw it in 3D says that it doesn’t distract from his movie. With the right application, 3D can complement the experience. But the same movie in 2D will still work if the story line is any good.

Now 3D is a gimmick for getting people in the theater *cough* Last Airbender *cough*. But it can’t make a bad movie better. Alice in Wonderland was a good movie and I think that the 3D gimmick would distract from that.

The SCOTUS handgun ruling

From the New York Time letter page. This is not my letter, but the sentiment is the same.

To the Editor:

Every year, millions of people across the United States willingly have their First Amendment rights to free speech and assembly restricted when local governments hand out permits for parades. The governments decide who can march, where they can march and when they can march, and require them to have a permit.

The recent Supreme Court ruling on the Second Amendment seems to set the right to buy and bear arms above the rights of the First Amendment. It deprives local governments of their right to decide who can carry a weapon, where they can carry a weapon and when they can carry a weapon, and, for all we know today, may lead to a time when people can carry concealed weapons without a permit.

Words are almost always harmless. Unfortunately, guns, by design, are never so.

Zachary I. Gold
Massapequa Park, N.Y., June 29, 2010

That’s what I don’t get. We routinely accept controls and limitations to our constitutional rights and these are done as a “common sense” measure.

No one says “let’s stifle freedom of speech and assembly”, but I can’t get 200 of my close friends for a protest without filing and obtaining a permit.

We have freedom of speech but no one expects that to permit someone yelling “FIRE!” in a crowded theater.

How are guns different? We can restrict some rights but why does the 2nd amendment get a pass on limitations or controls? I know full well that the ruling is about the outright ban on handguns, and is not about “Guns for everyone!” But if the law is re-worded, will it still pass this test?

Why can’t a state regulate that some types of guns are just not allowed?

Thumbnail credit goes to leasepics / Lala Roe for the image.