Chrisdigital's Blog

Tech Notes, Code Tips, And Musings By Chris Carvey, NYC UI/UX Director

Powered by Genesis

You are here: Home / Archives for customizing WordPress themes

SASS + Codekit + WordPress Theming

August 8, 2013 By Chrisdigital Leave a Comment

SASS + Codekit + WordPress Theming: reverie-and-sassRecently I decided to revisit my interest in using SASS as a component of my WordPress theme development skillset. I began this process by looking around at my WordPress starter theme options that utilized a CSS preprocessor as part of its workflow. I briefly considered using Bones before eventually settling on Reverie (which is actually a Framework not a starter theme.) I have a specific use case in mind for the themes I’m building and I concluded Reverie stood out for its simplicity and would play nice with Gravity Forms and mobile templates after some rudimentary testing.

What’s All This Sass About?

Well, SASS is a CSS metalanguage that extends on CSS3 standards by adding sweet features like mixins, variables, includes and the like. There are a lot of benefits to using it with a CSS preprocessor or CSS framework (like Compass) that mainly have to do with trying to apply OOP (Object-Oriented Programming) principles to your theme code and leveraging reusable CSS variables throughout your projects. Here are three posts that go in-depth on the topic:

A. What is a difference in CSS frameworks vs preprocessors?

B. Cross-Platform Sass and Compass in WordPress

C. Getting Started With Codekit + CSS Preprocessors (Post includes a video.)

D. Syntactically Awesome Stylesheets: Using Compass In Sass

Designers love Sass and CompassWhat is also cool, is the emergence of GUI tools like CodeKit to help make this a real viable workflow for developers and designers alike. Having worked a bit with SASS during my stint at E9 Digital I was eager to exercise these muscles again and after some hiccups with Mac OS / Mountain Lion / RUBY configuration I was well on my way. I threw this post together to help those also starting down this road.

Getting Started

This post is a bit Mac OS-centric (Mountain Lion specifically) but nevertheless developers that use other operating systems should be able to figure this out using the information provided below. Here’s a list of steps and resources that helped me get up and running:

Step 1. You’ll need to fire up Mac OS X’s native Apache server local environment or use something like MAMP that is independent of the OS.

Step 2. Download WordPress and Download Reverie (which is based on ZURB’s Foundation.)

Foundation-responsiveStep 3. Make sure your development environment is up to date and/or install a “fresh” Ruby build and all the necessary gems and Compass.

A. Sass / Compass / Foundation / Mac Setup (Video)
This video covers some nuances of Codekit setup not covered elsewhere… (like switching the version of Compass you’re using to compile your code.)

B. Foundation Developer Documentation

C. Installing Compass

D. How to Install Xcode, Homebrew, Git, RVM, Ruby & Rails on Snow Leopard, Lion, and Mountain Lion

E. Ruby on Rails development with Mac OS X Mountain Lion

And Now For The Tricky Part

You may need to tweak Codekit settings to get your configuration just right.As you may have noticed, all the tutorials above focus on various pieces of the puzzle but don’t quite pull everything together in context. This can cause some confusion, that is now compounded by the fact that Compass, Foundation, CodeKit, and Reverie can be used independent of each other (or standalone if you prefer that phrase) where in the past some of these components were more tightly integrated and packaged together. Needless to say, it takes some patience and “massaging” to get this right especially if you’re working with pre-existing code or a theme like Reverie.

As I alluded to above, you may have to dig into CodeKit preferences to change preset folder names as I did. I made the mistake initially of trying to conform to the naming standards Compass wanted, but realized Reverie’s directory naming structure was engrained in the template code to a degree that made me change course. You might find this easier or less of an issue with other themes, but this tripped me up for a few minutes.

Sassy Starter

For example of a simple starter theme, you might want to check out “Sassy_S” which is the popular “_S” aka “Underscores” starter theme refactored into SASS partials.)

I hope this helps you fast track your efforts.

Speak Up

Have any tips to share? or any experiences with this workflow? Please share them in the comments.

Read more on ChrisDigital’s Digital Designer Blog:

1. Customizing the WordPress Admin : WPNYC Meetup Recap

2. My WordCamp NYC 2012 Recap : 800 WordPress fans assemble

3. Responsive Design: WordPress NYC Meetup Recap

Filed Under: WordPress Tagged With: CodeKit, customizing WordPress themes, Foundation, SASS

Customizing the WordPress Admin : WPNYC Meetup Recap

February 22, 2013 By Chrisdigital 3 Comments

Presentation screen : Tailoring the WordPress Admin for Clients and WorkflowsLast Tuesday, on a drizzly February night, several scores of intrepid WordPress fans came out to the latest WordPress NYC meetup, “Customizing the WordPress Admin” hosted at New Work City. I have been rather busy in recent months and I found this latest subject rather serendipitous. Why you ask?… well, you may recall that last Summer’s WordCamp New York Meetup was jam-packed with good information and as an attendee, I couldn’t experience all of it. Needless to say, choosing which seminars to attend seemed like a series of terrible sacrifices. But, I was happy to learn that Helen Hou-Sandí (Director of User Interface Engineering at 10up) was doing a reprise of her talk that I missed last June on customizing the WordPress administrator’s control panel for our group. As a sweetener, Boštjan Špetič of Zemanta walked us through a very new and hip way you can find and assess WordPress plugins.

OMG 23,000+ Plugins! What Do I Use?

Boštjan Špetič walks us through his RankWP site which features WordPress plugin search engineThe first presenter at the meetup was what I consider a bonus treat. Boštjan Špetič (CEO of Zemanta) gave us a peek at his freshly launched side project RankWP.com. He, like most people, can be easily frustrated with the WordPress.org plugin directory index and sought to re-think it completely as an experiment. So he “scraped” that entire section of WordPress.org and built a functioning demo of how he imagined it working. Thus, RankWP.com was born. To be honest, it’s pretty freakin’ cool. So much so, I thought it stunned most of the attendees as he detailed the work he put into it. RankWP.com should become an essential tool for how we all decide which plugins to use with our personal WordPress installs in the future for reasons that are self-evident; it’s much easier to find contextual and relevant results for items you’re looking for over the WordPress.org Plugin Index.

A look at Rank WP's homepageIn response, the crowd gave some great constructive feedback and I am very excited about where the project will go in the future. The crowd wanted to see the compatibility with the current version of WordPress and when the plugin was last updated in search results, among other comments. This is certainly a good supplement to my usual googling for “top” or “best” plugin lists for a required feature if I’m not interested in building it myself.

Oh, Man This Should Be Good

As most of you know, that tune in for these recap posts- I write these recaps as exercises to clean up my notes and help some of the information I have learned “stick.” This meetup’s main topic was especially relevant to me since I’ve primarily been using WordPress as a content management system for my clients for the last several months. I’ve utilized a series of plugins and self-learned tricks to integrate jQuery UI and home-brewed enhancements to the admin interface to make data entry easier and less confusing for my clients. I was very interested to learn and hear what more experienced developers were doing on this front. Since Helen Hou-Sandí is a WordPress core committer and was leading the charge on Post Formats UI and WordPress CSS standards, I was fortunate to slide into the event last minute to learn from a seasoned pro.

I’m Not Worthy

Helen Hou-Sandí speaks to 100+ assembled at WPNYC meetup re: Customizing the WordPress AdminThis presentation did not disappoint, because some of the things Helen covered I would probably not have thought up myself…. How about a tweak that doesn’t break the “featured image” association with a post until you actually want to update the post? OK, how about a page layout preview / “staging” engine entirely built in .js (Javascript) before your client hits publish? Setting up a staging environment for WordPress is a famously “hairy” and painful proposition with many approaches. This is an investment of time and resources most clients don’t even have the imagination for. But, making edits to a “live” site is not ideal and I ran across Ramp doing my own research on the topic. Which was an option Helen mentioned as an up-and-coming alternative that everyone has said good things about, but I personally have no experience with. I can see how and why she “baked” her own solution to a vexing problem, which was pretty awesome to see in action. The other very cool thing I can mention were the project scheduling & assignment screens she showed that were built on top of a feed from Basecamp and custom taxonomies. That was pretty sweet.

Customizing Post type Icons with CSS SpritesI won’t mention all the examples Helen illustrated because I’m not sure it’s appropriate (some of it was advanced client-related work), so please reference her slides. But by far her most relatable admin hack was simplifying and smoothing out media content uploads pre- version 3.4. Several months back (before 3.4) there were a lot of UI frustrations with the WordPress image uploader, so she got it there and streamlined the process for her clients. She warned that a lot of techniques covered like this one were for pre- 3.4/3.5 but they are still relevant depending on how custom an experience you’re trying to build. This was a pretty great example to see.

Helen also got into minutiae of using css sprites for your custom post type admin icons and their hover states. Use them or Helen will find you :-) Here is a cool icon template I found.

Note: A link to her slides are below.

Decisions, Not Options

In her intro, Helen dug into WordPress philosophy a bit, in particular the “Decisions, not Options” section, which states:

“When making decisions these are the users we consider first. A great example of this consideration is software options. Every time you give a user an option, you are asking them to make a decision. When a user doesn’t care or understand the option this ultimately leads to frustration. As developers we sometimes feel that providing options for everything is a good thing, you can never have too many choices, right? Ultimately these choices end up being technical ones, choices that the average end user has no interest in. It’s our duty as developers to make smart design decisions and avoid putting the weight of technical choices on our end users.”

This roughly translates into really knowing your content administrators and their needs intimately and stripping out any obstacles and challenges to their success in the admin interface. The other side of the equation is adding to or enhancing WordPress custom features that are unique to that client’s publishing experience.

Get Your jQuery On

Helen walks us through featured image meta box admin enhancementjQuery UI was a big aspect of the presentation and Helen noted that it snuck into WordPress’ core install recently, just not with the accompanying CSS apparently, so you have to style it yourself. Following up on this post- presentation, I learned jQuery UI is now native to WordPress as of 3.3.x. Here’s a great tutorial on some of the possibilities for the Admin UI, and that tutorial covers the jQuery UI integration I just mentioned. Helen specifically highlighted nice examples like adding a jQuery UI datepicker and jQuery UI slider to a form (e.g. for age range) instead of standard select elements. She also went into detail about injecting Javascript inline by echo scripts through WordPress template hooks. I prefer my method of enqueueing what I would call a “junk drawer” file named something like “application.js” that loads last and tests for user events or a DOM object and then runs the relevant scripts rather than sticking .js inline, but it’s a matter of personal taste. Her method also has the advantage of calling relevant code snippets when needed. It’s probably semantics, but it might matter depending on your specific execution, the scale of your application code base, and what you want to maintain.

[Her slides are here].

Plugins Mentioned…

Post 2 Posts

Helen discusses her appproach to A close up of media upload enhancements to adminHelen gave the example that this plugin is very useful in creating “many to many” relationships between data nodes (e.g. people –> companies –> many companies)

Advanced Custom Fields

I’ve used this myself recently and it is awesome because I know what it’s like to do this manually.

Simple Page Ordering

This one is nice, but I’ve personally use CMS Page Order and I really dig it.

*Note*– See her slides for other plugins and Github code she mentioned.

Some Other Plugins I Use To Customize The Admin…

I’ve used this premium plugin a couple times: White Label Branding for WordPress and here’s a free one that comes close to the features: White Label CMS.

Hardcore Mom Award

Special thanks again to Helen Hou-Sandí for reasons stated above and as you can note from the pictures, she is with child. I already knew she was a hardcore WordPress user from last summer’s WordCamp, but my respect for her has now been cranked to “11.” If I were pregnant, I would have found a number of other things to do on a drizzly Tuesday night than present in front of a room of 100+ people.

Some Random Items And Announcements I Noted…

Steve, Jolie explain situation with the videos and other annoucements•Helen noted in her presentation that 10Up is growing quite well with about 23+ people now and considers it to be one of the largest WordPress consulting shops in the country.

• I appreciated the dedicated time at the end of sessions for networking and Steve for pointing out how active the wpnyc.org job board is. That was very good news.

• New Work City is coming along quite nicely. They may have one of the nicest spaces for meetups and the largest presentation screens I’ve ever seen.

•The official start time for the meetups is 7pm now, no longer 6:30pm.

• WPNYC meetup is also looking for help to edit the tens of videos still left to get cleaned up from last summer’s WordCamp, synced with audio and outputted to a format ready to be put online. They are also in need of assistance getting captions placed in all videos, but specifically the meetup videos. Contact Joly for more info.

• Also, the meetup’s price is going up to $6 for a trial period. The money from the extra $1 will be split between a door prize of around $50 dollars to a lucky attendee and a donation to a WordPress developer that gives back to the WordPress community. Rules and restrictions are being discussed as we speak.

“Don’t Email Steve”…

If you want to learn more about the WPNYC group, check out on Meetup.org. When we’re not meeting up check WPNYC.org. Attendees meet up the third Tuesday of every month, some say religiously :-)

On a final note, I want to make a last shout out to Tom Harrigan of RootBuzz (go check out what he’s up to). He dropped his spot on the guest list so I can get in.

Did I miss something? Have something to say?

Feel free to add comments and additions below. Thanks!

Resources:

  • 1. Helen Hou-Sandí slides from this presentation: Tailoring the WordPress Admin for Clients and Workflows
  • 2. “The Design of Everyday Things” by Don Norman was mentioned as a source of inspiration for UI/UX design by Helen.
  • 3. Media-models.js and Backbone.js were mentioned briefly.
  • 4. Complex Meta Boxes in WordPress
  • 5. SpeckyBoy: 20 Snippets and Hacks to Make WordPress User-Friendly for your Clients
  • 6. Add a character counter to excerpt metabox
  • 7. How to Limit the Display of a WordPress Meta Box
  • 8. Add a jQuery DatePicker to Event Posts {WP}
  • 9. Creating Admin Themes
  • 10. Tuts+: How To Change Your WordPress Publishing Workflow For The Better
  • 11. Smashing Magazine: Six Revisions: How to Customize the WordPress Admin Area
  • 12. Smashing Magazine: Smashing Magazine’s How To Customize The WordPress Admin Easily
  • 13. Justin Tadlock: Uncluttering the post editing screen in WordPress
  • 14. Smashing Magazine:Useful Free Admin Plugins For WordPress
  • 15. WPBeginner: How to Improve your Editorial Workflow in Multi-Author WordPress Blogs
  • 16. Ulancer: Improving the WordPress Admin’s Workflow
  • 17. Hacking the WordPress Admin: Mastering Custom Columns
  • 18. [Video] Alan Cole’s talk last October about: Growing Pains: Experiments with Child themes and why I stopped using them.
  • 19. Tuts+: Customizing Your WordPress Admin
  • 20. Smashing Magazine: How To Improve And Refine Your WordPress Theme Development Process

Filed Under: WordPress Tagged With: #wpnyc, customizing WordPress themes, Recap, Using WordPress as CMS, WordPress CMS

Filtering WordPress categories using hooks

April 10, 2010 By Chrisdigital Leave a Comment

Ryan Marganti discusses filtering WordPress CategoriesRyan Marganti over at SoulSizzle.com runs through what WordPress hooks are, and how you might use them including some simple examples. He reviews WordPress filters, edits to your functions.php file, the get_terms hook, and where you might find out more references about hooks. This is a nice introduction for WordPress theme or plugin developer newbie. Check out his other posts while you’re over there.

Filed Under: Bookmark Links Tagged With: customizing WordPress themes, Plugin hooks, WordPress, WordPress CMS, WordPress hooks, WordPress theme tip