Author: Mike Auteri

  • How to create unique widget areas for individual posts in WordPress

    How to create unique widget areas for individual posts in WordPress

    Here’s a cool little trick for adding widget areas that are unique to posts, but without cluttering up Appearance->Widgets in the admin. Instead, we utilize the Customizer, which is perfect for this sort of thing.

    First thing, we need to hook a function into `init` where we register our widget area.

    (more…)
  • The Day After WordCamp US

    The Day After WordCamp US

    I was fortunate to be able to attend the very first WordCamp US this past weekend. It was held in Philadelphia, which is a reasonable drive from where I live in North Jersey. It’s also usually hard for me to get away these days since I have a 17-month-old child, but luckily, my wife was fine with me going and taking all the parenting responsibilities on herself for the weekend. God bless her.

    This was by far the biggest WordCamp ever, with around 1800 people in attendance. I’ve attended WordCamp NYC and WordCamp Boston in the past, neither came close to the size. I was in awe.

    Though it was a huge event, it didn’t take long for me to find people I knew. One of my favorite parts about WordCamp is the people. The people I already know, meeting new people, and becoming better acquainted with people I don’t know well or only know online. WordPress really is a friendly community. Probably the friendliest that I know of.

    During the State of the Word, Matt Mullenweg (or is it Mullenburg now?) was very passionate about everyone learning JavaScript. Saying that it is the future of WordPress. After all, there is a LOT more JavaScript powered components in WordPress, a new REST API, and just look at Calypso. All JavaScript.

    This really resonated with me. Before I started working with WordPress full-time 3.5 years ago, I was a JavaScript developer. I still very much love JavaScript, but find myself writing much more PHP code and much less JavaScript as a WordPress developer. I have also fallen behind a bit with all the cool new JavaScript frameworks (Backbone, Angular, Ember, React, etc.) that are powering today’s web sites and web applications.

    So when I attended Contributor’s Day, a day where people of all levels get together and work on WordPress. Instead of grabbing any ol’ ticket (like I usually do), I decided to focus on a component. Given that media is heavily JavaScript, I went there, found a ticket, and created a patch. In addition, I read through a lot of the Backbone code powering the media modal to see how it all works together.

    My grand plan is to continue contributing to WordPress, and apply my efforts to one thing: JavaScript in the media modal. This will help me focus and keep me motivated to contribute. It will also allow me to get my JavaScript chops up to snuff.

    So there you have it. I feel this is the WordCamp that really got me motivated. I’m already looking forward to next year’s WordCamp US, which is going to be held in Philadelphia again!

    And though I had a great time, nothing beat coming home and seeing the excitement on my little girl’s face when I walked in the door Sunday evening. I’ll leave you with this video I tweeted of her learning to say Wapuu in her new WordCamp US onesie.

    Feel free to leave your own experiences and takeaways of WordCamp US in the comments. I would love to read them.

  • Use jQuery to center element in viewport

    Use jQuery to center element in viewport

    I wrote this bit of code for a knock-off Google Image UI I’ve recently been working on.

    Like Google Image search, my UI opens the image details below the thumbnail on click. Within those image details are forward and back arrows to navigate previous and next images. This script adjusts the vertical scroll as I click those navigation arrows keeping the image details centered in the viewport.

    	var $window = $(window),
    		$element = $('.my-element'),
    		elementTop = $element.offset().top,
    		elementHeight = $element.height(),
    		viewportHeight = $window.height(),
    		scrollIt = elementTop - ((viewportHeight - elementHeight) / 2);
    
    	$window.scrollTop(scrollIt);
    
  • Last weekend at WordCamp NYC

    Last weekend at WordCamp NYC

    This past weekend was WordCamp NYC 2014, and I must say, it was a huge improvement from previous WordCamps in New York. It’s no secret that I’ve been a bit critical of New York WordCamps in the past.

    For the record, I’ve only been to WordCamps in two cities: New York and Boston. Until now, Boston was doing it right and New York wasn’t. I’m mostly referring to number of different tracks. In 2012, New York WordCamp was a hot mess with 13 tracks. They literally gave a talk to anyone that wanted one. It was next to impossible to choose which talks to go to and which to skip. I ended up going to a lot of lousy talks.

    Boston WordCamp 2013, in contrast, had 4 tracks, only 2 of which were dedicated to development. So basically, my decision was this or that. I ended up going to a lot of great talks there. New York WordCamp 2014 followed this format of 4 tracks and it was much, much better. Props to the coordinator, Eric Andrew Lewis.

    In addition to WordCamp, I decided to participate in Contributor’s Day the Friday before. There I met Ryan McCue who is leading the effort in the new WordPress REST API, slated be included in the 4.1 or 4.2 release. It felt really good working with him and writing some code for that project. I’ve contributed to WordPress 4.0 by closing the same ticket I opened, but Contributor’s Day is definitely a great environment for the newbie wannabe contributor (like me) to get involved, since there’s so many people to help and support you.

    Unfortunately, I wasn’t able to attend Sunday’s sessions. Being from New Jersey and having a new baby doesn’t really allow me the freedom I once took for granted. I would have really liked to attend Ryan’s talk on the REST API, Helen’s on WP_Query, and Daniel’s on WP-CLI. I guess I’ll just have to catch those, and others, when they become available online.

  • Hello World! Emily Lorraine Auteri is here.

    Hello World! Emily Lorraine Auteri is here.

    Emily Lorraine Auteri
    Emily Lorraine Auteri

    It’s been quite a while since I tried to maintain a blog. I came close a couple years ago, but ended up hating all my posts and deleting the blog. So it goes…

    I’m currently on paternity leave from work. My daughter, Emily Lorraine Auteri, was born on July 4th. Like our forefathers declaring independence from British rule, Miss Emily declared her independence from my wife’s womb.

    The picture I included with this post is my favorite photo of her thus far. My father took it. She’s quite the alert baby as you can tell.