Let’s set the stage. You want to take a trip to the Grand Canyon with your family of 4, but plane tickets cost $1000 each. Plus there’s the hotel for a week and food, not to mention other expenses. Instead, you decide to take a few extra days off work and drive there because it would save you literally thousands of dollars. What if someone told you that if you can’t afford to fly, you shouldn’t go? Now think about this: you just started a business and you know you need a website but you can’t afford a $5-10K one. Someone you know says they can make a website for $500 using WordPress and a page builder. Are you wrong for accepting that? I say no.
I don’t know why, but for some reason, I thought WordPress already included the slug of a post or page in either the function
post_class(). Doing some work over this weekend I realized that’s not the case, but luckily, it’s very easy to do.
post_class() serve as a way for you to easily customize a page’s CSS based on attributes of the page being viewed. They will output things like the post ID, the custom post type, if the page is the blog, home, or front page, and more. One thing it does not include, however, is the post slug. This could be useful if you want to style each of your posts a certain way, or in a more likely scenario, style each page a certain way. If you want to do this, the code is fairly straight forward; both functions accept an option argument: a string of your own classes. We use that combine with the $post array, like so:
<?php body_class($post->post_name); ?>
or, if you want to do it on a post-by-post basis:
<?php post_class($post->post_name); ?>
Note the latter must be used inside the Loop. Using this, if you have a page named, “Services” with the slug services, the output would look something like this:
<body class="page page-id-108 page-parent page-template-default services">
Now you can use the .services (or whatever) class name to do some custom stuff instead of needing to know the page or post ID.
I’m going to be honest here. 2012 was a pretty great year for me. A lot of amazing things happened in both my personal and professional life; most publicly, I got my first book published, and I hope do the same in 2013. While I don’t have too many traditions on this blog (something I hope to change in 2013), my Favorites of the year post has been a pretty good staple.
- 2009 Called (xkcd): I will have to remember this one.
- .tel, .xxx, and .mobi are all pointless and idiotic: Agreed. There’s really no way to prevent sites that fall under these categories from purchasing the .comÂ equivalent, or vise-vera.
- The State of the Freelancer: I love me some nice infographics.Especially helpful ones.
- CBS will Remove some Showtime Shows from Netflix (bgr):Â Translation: People weren’t buying Californication or Dexter on DVD anymore. I guess I won’t become a Californication fan then…
- Friday by Rebecca Black- Cover by Matt Mulholland (youtube): Awesome. Thank you @joelmchale
- What we Have to See in iOS 5 (brg): He’s right on all account, especially that people are going to buy it anyway.
- Amazon.com lets you play with an Android virtual machine, try apps before you buy them (engadget): This is pure awesome. Couple that with the fact that they give an app away everyday, and you’ve got a really great Android Market competitor.
- 5 Things They Never Told You (cracked): This is by far the best cracked.com article I’ve ever read.
- 18 Million WordPress.com Websites Now Available in iPad Format (mashable): They are using a (free!) plugin called onswipe. It’s now being used on this site as well!
- The Path to Productivity: Short Hours, More Breaks (workawesome): I like to break my day down into tasks that I complete then follow with a quick break. However, if I am in a groove, do not disturb me!
- Web Standards Sherpa: This website sets out to promote web standards through articles and feedback from the experts! If you’re a web developer, this is a no-brainer as far as must reads goes.
- Microsoft to Discontinue Zune (bgr):Â That is a damn shame, as the Zune is a MUCH better mp3 player than the iPod. Maybe if Microsoft ran an ad or two…
- Making Twitter More Secure: HTTPS: Twitter has now added an option to force all of your Twitter dealings to use secured browsing. I strongly recommend turning this setting on.
- You Have a Disease; Here’s the Cure (nettuts+): Just because the Internet is always on doesn’t mean we have to be too.
- Microsoft is More Ethical than Google, Apple, and Facebook: Take note, Fanboys (as a Google Fanboy, I am included)
- Android’s Browser is Way Faster than Safari on the iPhone (gizmodo): In the words of Steward Scott, booyahh.
- Over-the-Air iTunes Syncing now Free for Android (lifehacker): I’ve been testing Music WithMe- seemed shaky at first but it’s working now and is really awesome!
- Yanko Design: Some really inspiring & innovative product design here.
- Dabble.In: A new website that asks, “What do you Dabble?”
- 10 Tips for Working While on the Go (lifehacker): Pretty helpful stuff here- especially if you travel a lot.
- Why You Should Keep a Mileage Log (workawesome): This can save you quite a bit of money at tax time!
- Anaheim school district handing out GPS trackers to chronically absent students (engadget): Having trouble with a student? Lojack them. I can’t see anything wrong with this.
- Know Your Way Around Facebook Privacy (web.appstorm): Web.Appstorm published an article of mine that serves as a pretty comprehensive guide to Facebook Privacy. You should check it out.
- MLB Dedicated to Educating on Tobacco Risks (mlb.com): My question is why are US Senators getting involved at all. Dear Representatives, it’s not your job to tell us what to do, or to prevent people from poorly influencing us, or to protect us from ourselves.
- 60 Beautiful Wallpapers for Your Android Phone (android.appstorm): Some really nice wallpapers here. I picked up a few myself!
- Apple to Announce iPad 2 March 2nd, WSJ Reports (bgr): Begin the tablet frenzy 2011. My money is on the Moto XOOM being a better device, but I’m a little jaded.
- 6 Bad Habits to Blame on Technology: Everyone should read this. Fact: It’s no OK to constantly text someone while you’re having a conversation with someone in real life. Get some damn manners.
- If Apple Made Bottled Water (image): “If you’ve been drinking the juice, you’re ready to drink the water.”
- The PHD Comics Guide to TA Office Hours (comic): That attendance graph is 100% true.
- The Likeability of Angry Birds (theoatmeal): Also True. I hate that green bird.
- How The Social Network Saved Mark Zuckerburg (wired): Really good read. I actually think the movie villainized the twins who sued him more.
- What Happens if Yahoo!Â AcquiresÂ You (37signals): This is the main difference between Google and other companies. It’s really a shame what Yahoo! does to great web apps.
- Visualized: Android activations mapped geographically, chronologically, breathtakingly (video, engadget): This, is a very cool video.
- Design and Develop a Complete Website, Part I (webdesigntuts): I think I’m going to do this just to try and change up my design process a little.
- What is the Internet? (video): This video has been flying around the Internet all week. One note is that this was in 1994- less than 17 years ago. It’s amazing how much has changed since then.
- Shutting Down the Internet (pcmag): There is a bill in Congress that would give the President the same power Egypt has, to kill the Internet is need be.Â What does Congress have against the Internet? This is a terrible idea and it will be a sad day in America if it’s passed.
- Google, SayNow, and Twitter team up to make Tweeting from Egypt possible via voicemail (engadget): And this is what make great American companies so great.
- The TSA’s new Body Scanners Spot Bombs, not Dongs (gizmodo): Big change from November, and a big win for everyone who spoke out against the full body scanners.
- Microsoft’s Bing uses Google’s Search Results- and Denies It (google blog): This post explains the experiment Google ran to confirm Bing was stealing their results. Microsoft doesn’t really have a lot of wiggle room here.
- The White Stripes Split (spinner): This is upsetting, though I do like the Raconteurs a lot more.
- Five Ways the Google-powered Tablet is Better than the iPad (lifehacker): I watched the event last week that demoed some of the cool stuff Android 3.0 (called Honeycomb) does. A lot of it is very well done.
- Setting the Record Straight (bing blog): Oh God, it’s a flame war, big corporation style.
- Current Crop of Tablets, Compared (lifehacker): Really helpful- The Moto Xoom looks like the leader of the pack.
- Verizon can now throttle top five percent of bandwidth hogs, downres multimedia transfers (engadget): “Here at Verizon, we like to do 1 really popular thing, follow by a bunch of really, REALLY unpopular things.”
- Palin: America out of Step with Reagan’s Values (usatoday): While she’s right, she isn’t the person to bring us back to them.
- You can Now use Basecamp on your Mobile Phone (37signals): This excited me. Also, they went with a mobile-optimized interface instead of native apps. I think this is a very smart move.
- CSS Properties that Affect Type Rendering (typekit): I’ve has some issues with this recently, so the article is very helpful!
- How to Tell when Your Rates are Too Low (freelance switch): I experienced this over the summer- very true!
- The New Bulletproof @font-face Syntax: Now with support for mobile platforms.
- Pettitte calls it a Career After 16 Years, 5 Rings (yankees): I’ve been watching Andy since I started watching baseball. I will miss him and his rock-solid post season performances
Some other news: Â Today is Super Bowl Sunday (go Pack!), as well as Ronald Reagan’s birthday. Also, I worked on a simple Reading List plugin for WordPress this week. You can see it in action on my blog here, though I have made some changes that I will release this week.