Post meta as post object method

Thanks Erick Hitter for presenting this at WCPHX

In WP >=3.5


global $post
$meta = get_post_meta( '$post->ID, 'my_key', true );

… is the same as …


global $post
$meta = $post->mey_key;

Nitti

It’s got a weird name; apparently it was named after an Al Capone henchman. Nitti is the font that IA writer selected for their popular writing apps. It’s monospaced, beautiful, and I want to put it in my code editor. In fact, I’d be happy if pretty much everywhere I did writing had this font.

If anyone is feeling particularly like they’d love to buy me a license, I’d like, at least, the standard and web version of Nitti basic light, Nitti basic light italic, and Nitti basic light bold—six fonts total. Having on hand Nitti regular and Nitti regular italic would be nice to have. Pricing is in euros, so at the moment that doesn’t help.

Nitti Light in IA Writer
Nitti Light in IA Writer

comment_reply_link add_below argument

When you’re writing your own custom comments callback, you’ll likely need to write-in a template tag called comment_reply_link. This template tag takes an array of options, one of which is add_below to direct where the comment reply form should be appended.

When it runs, the value of add_below is appended with a dash and the ID of the current comment. So it’s important that the ID of where you want the comment form to pop under is the same.

Thirty before Thirty

Thirty things I’d like to accomplish before I turn 30. I put it here so the internet might hold me accountable.

Progress on this list:

Progress toward 30 (from the time this list started):

67.33%

  1. Finish a WordPress based choose-your-own adventure theme that I’ve been working on (intermittently) with my sister for the past few months…
  2. Finish a WordPress theme for composers / solo musicians that I’ve been working on with some musicians over the past year or so…
  3. Finish my eBook about WordPress for artists and the accompanying theme that I’ve been working on for the past year…
  4. Go on a long backpacking trip. The Wonderland trail would be nice.
  5. Get a passport
  6. Use my passport
  7. Work at some other place for a few weeks or a month via Airbnb or other arrangements.
  8. Successfully brew my own beer. Successful means it actually tastes good
  9. ████████ (redacted for privacy)
  10. Visit D.C. and New York
  11. ████████ (redacted because it’s a surprise)
  12. Get (either buy or rent) a home that can support a large enough table to host ongoing game nights. Host them.
  13. Learn how to do letterpress printing and do a reasonable run of nerdy greeting cards
  14. Convert one of these little hobby things into a second income stream. Actual dollar amount is irrelevant for the purposes of this goal. Should be reasonably self sustaining and steady.
  15. ████████ (redacted because it’s personal)
  16. Get something funded on kickstarter
  17. Actually write the letter to BSA and send it.
  18. Plan costs, itinerary, and logistics for a through-hike of the PCT — including what it would take to get it funded via kickstarter
  19. Take a class. Any class. Writing, typography, graphic design, computer sci, whatever.
  20. Pay off truck
  21. Pay off student loans
  22. Have at least a three month cushion in savings as defined by whatever my expenses are when I turn 30.
  23. Through-hike the Wildwood Trail (It’s kind of cheating, because I was already planning to do this, before devising this list. I don’t care, I want the quick win)
  24. Get good photos/headshots taken for gravatar, twitter, speaker headshots, etc.
  25. Learn the basic of Adobe After Effects and make something cool.
  26. Get a dog.
  27. Migrate all of my sites to an nginx unmanaged host.
  28. Read 30 books
  29. Don’t touch a computer for a week
  30. undecided

Don’t use target=”_blank”

I’ve been asked a few times in the past year about opening links in new windows. Just because a tag, property, or attribute is there — even valid — doesn’t mean it’s appropriate to use. For instance, did you know there’s a valid CSS property to make things blink a’la the infamous <blink> tag? Doesn’t mean that’s okay.

Anyway, I wrote a blog post for 10up on the topic in case you want to know what you should be doing.

Find my iThingy

I’m sure there are plenty of heartwarming stories about how Find my iPhone, the Apple device locator app, has reunited them with their iThingy. I should have one too. My story turns out fine, don’t get me wrong:

Boy loses device at coffee shop. Boy doesn’t realize until days later when he goes to watch Netflix. Boy looks through house. Boy uses Find my iPhone app. Boy locates iPad at coffee shop where it had been rescued and turned in.

But here is where there is supposed to be jubilation, jumping up and down, happy dances, and drinks-all-around. I did none of things. I think I was more excited when a friend caught my obscure Eddie Izzard reference yesterday. Boy leaves coffee shop with shops reasonably glad he found it, but also kind of annoyed.

Am I just not that attached to it? I know now that I don’t deserve it. Maybe I should sell it and buy my parents a proper Mac. It has been useful for testing websites and I enjoy it for things like Netflix and reading newsfeeds. Maybe I’m just annoyed at myself for having lost it in the first place, and not excited because I’m tired?

Thoughts? Am I a spoiled suburban tool having a serious #firstworldproblem? Or?

Responsive Advertising

There’s been a lot written about the problem of advertising on responsive devices. Quite a bit less has been written about potential solutions. Virtually nothing has been written about solutions that take into account the way things currently are.

Thing is, I need that solution. So, I’m defining my problem here as a way of thinking through it. If I figure out a non-compromising solution, I’ll post it later.

Truths:

  • Advertising cannot simply be “display:none” on smaller screens since that will count as an impression, and for CPM we don’t want to bill people for times their ads weren’t actually displayed.
  • Advertising code sucks, it comes in iframes, and javascript, and flash, and does it’s very best to be it’s own entity on your page without any regard for anything.
  • Responsive design uses media queries to resize the page, but media queries can’t turn on and off advertising (see the display:none thing). We’re also going to ignore UA sniffing server side because that defeats the purpose of responsive.

Because of all this, my basic approach will mimic what I picked up from this article: http://www.ravelrumba.com/blog/responsive-ads-real-world-ad-server-implementation/ In essence, we set break-points in javascript that correspond with ad locations being turned on and off. Then, on page load, the javascript will put ads in the locations where ads are visible.

Additional difficulties

  • I have one theme being used for several sites, each of which have different advertising tracking/placement codes. Those codes need to be set in the WordPress administration panels somewhere
  • Codes differ for mobile and non-mobile ads.
  • Ads are being served from two sources (not just one ad network), so the embed code varies in structure.