April 18, 2011

CSS3 Columns in WordPress after a Certain Word Count

I've been using CSS3 Columns for various purposes lately. I've been really loving it. Especially how easy it is to manipulate from 3 to 2 or 1 count with media queries. More on that stuff later. The purpose of this post is mainly to share with you (and document) how to use this in WordPress and only when your content is over a certain length. (what is the point of having three columns if there only one to three lines each?!)

first of all: make sure you have your CSS3 columns setup for the first div class:

[code]
.article-col{
-moz-column-count: 3;
-moz-column-gap: 40px;
-moz-column-rule: none;
-webkit-column-count: 3;
-webkit-column-gap: 30px;
-webkit-column-rule: none;
column-count: 3;
column-gap: 40px;
column-rule: none;
}
[/code]

and then here is how you explode your the_content(); - get your word count - and then change the div class depending on the limit.

[code]
ob_start();
the_content();
$content = ob_get_clean();
$numWords = sizeof(explode(" ", $content));
$limit = 100;

if( $numWords > $limit ){

echo '<div class="article-col">';
}
else {
echo '<div>';
}

the_content(); ?>
[/code]

your $limit can be set to whatever your design is comfortable with. also, you can class that second div with something else (you can do something creative like change the div from two col to three col depending on the word count.)

More on css3 columns:
http://www.alistapart.com/articles/css3multicolumn/

Love and use this to make it work in IE:
http://www.csscripting.com/css-multi-column/

Thanks @joncave and @petemall for brainstorming this a bit with me.
sara

April 11, 2011

Scout Blog Post: “Pushing The Boundaries: Harp Law LLC”

Here is a post that I wrote over on the Scout Blog, syndicated over here just in case you didn't catch it over there.

Pushing The Boundaries: Harp Law LLC

We are so pleased to announce the launch of Harp Law, LLC. Greg Harp came to us with his vision and style and asked us to give him a site that just suits him perfectly. We are not only pleased with the tailored design, but the functionality of the site goes beyond measure.

Greg is always on his iPad and iPhone and wanted a site that would display his content well, no matter what device he was using. We decided to give him the very best and build in automatic device adaptation into the heart of the code. Utilizing the technique called "Responsive Web Design", no matter if he's on an iPad in Landscape Mode to an Android or an iPhone in Portrait Mode, Greg's content and brand is going to put its best foot forward.

Q: Did you really tweak his site on all the various devices and resolutions?
A: Yes.

Q: Doesn't that take up a lot of time?
A: Yes, it does. But in the long run, it is worth it. Greg will now never have to worry about making a custom mobile site or if things are showing up right on the iPad. We've even built in touch swiping into the slide-show. Here at Scout, we want to make the future of good web design practices, a standard reality now.

Check Out The Website: HarpLawLLC.com

February 24, 2011

WordPress 3.1 is Out! Upgrade!!!

WordPress 3.1 is out! Upgrade! I'm so proud of being involved in this cycle. I was able to get involved in the UI Group and contribute this time around. If you've upgraded, go to your user and hit the blue admin theme! you'll see my contribution: a fresh new light blue upgrade. :) I feel so privileged that I was able to work with the UI group to make this change. It feels so good to be able to contribute back to the incredible platform that I love so much.

blue admin

While there are many awesome new features in WordPress 3.1 (you can read the post from Matt here) one of my favorites is internal linking.

Here is an awesome video made by Jon Cave that illustrates the process.

Road to WordPress 3.1 from Jon on Vimeo.

Thank You to everyone who helps make WordPress better!!!
sara

February 1, 2011

CSS at WordCamp Phoenix

I had a blast at WordCamp Phoenix this year! Here are my slides from my talk:

I cant wait to go next year. The town of Chandler was incredible and all the people there were so awesome and talented. Just being around everyone was so inspiring! Check out other speaker's slides here.

January 12, 2011

2010 – the year of WordPress

2010 has been an incredible year. It had its ups and downs. some parts were really hard and others just joyous! I've met some incredible people this year and got plugged into a great community that surrounds the very platform that this blog (and my livelihood) is based on: WordPress. Its been quite the journey. I've stumbled into great opportunities that led me to go many places and meet many new friends.

1/8-9 - WordCamp Atlanta

(Post on my talk: WordPress and Your Brand)

5/1-2 - WordCamp San Francisco

(I just went to this one: Recap Post1, Post2)

8/20-22 - WordCamp Savannah

(Post on my talk: Customizing WordPress themes / Child Themes)

9/18-19 - WordCamp Birmingham

(Post on my talk: Beyond the System Font: Advanced Web Typography) Other Post

10/16-17 - WordCamp NYC

(Post on my talk: Typography and Your Theme)

In conclusion: 2010 rocked my WordPress world. Thank you to everyone who has mentored me and guided me in the word of WordPress. And, absolute special thanks to those who contribute in any way to the release and improvement of this incredible software. - sara

December 16, 2010

WordPress Mode + Coda

I just have to say, this is incredible if you work in WordPress and use coda: http://pradador.com/code/coda/wordpressmode/
also, here are some WordPress clips for coda: http://coda-clips.com/category/wordpress
Thanks Dan!

Also, completely unrelated: this site is a great representation of responsive web design: http://hicksdesign.co.uk/
and I just love the colors and the awesome use of jQuery in this one: http://www.seattlesbest.com/

What are some sites you've been loving recently?
sara

December 15, 2010

For The Love of WordCamp / Speaking at WordCamp Phoenix

Over the past year and a half, I've dived into the WordPress community and have attended/spoke at various WordCamps. I am just so thrilled to be a part of this incredible community and even more thrilled that I get to share what I have learned and learn from others who are sharing. Growing with WordPress can't get better than this. The people that attend and speak at WordCamps are incredibly talented and I feel so blessed to meet, learn from, and help them in whatever way I can.

Some of these people I have gotten to know at various WordCamps over the past year and can truly call them my friends.  Thank You! You know who you are! I'm looking forward to making more friends in the years to come in this incredible community.

If you haven't been to a WordCamp, you should go. Talk to the people around you - see what they are working on. You might could help them with a problem and they might could help you. I guarantee you wont regret it. Also, If I happen to be there, say hi to me! ;)

WordCamp Phoenix

This January I get the awesome privilege of not only attending but speaking at WordCamp Phoenix. There is an absolutely incredible lineup of speakers and an awesome all-day design track. (I almost cried when I heard about this!) I can not wait. I will be speaking on CSS Tips. Come out to my talk if you are going! Here's the general lowdown:

CSS Tips

You've installed WordPress, everything is working how you want it to, you might have installed a custom theme or even your own theme, and now you're looking for something to either really make it stand out, or professionally refined. I have some CSS tips for you. From the real simple to the intense - designers and developers of all levels will walk away with something they can use. Here are some general topics we will be covering:

- CSS and WordPress
We all absolutely love WordPress - that's why we are here. (if you don't, come see me after) In this segment, we'll take a look at some CSS tips that directly apply to the use of our incredible platform. We'll be looking at different ways to refine the front end -  take a peek at some great WordPress site examples and inspiration - and go over some practical demos.

- CSS3
CSS3 is here and it can not be ignored! Yes we want some consistency in our site across all browsers, but there's nothing wrong with taking a wonderful design that works everywhere and adding in some subtle CSS3 pizazz. What a treat for users with updated browsers! We'll also address some tips on "faking it" in older browsers and fallback.

- Simple Takeaways
Think you know everything? We'll blast through simple CSS takeaways. You'll  probably end up using something in this list, or be reminded of things that you already know but are not currently utilizing.


If anyone has any particular tip that they would like me to include in my presentation, send them my way! Also, Thank you to the wonderful organizers at WCPHX as well as the sponsors! I can't wait.

December 14, 2010

A Website That Gives Back – Nonstop Advocates

(post syndicated from a post I wrote at scoutbrand.com)

Christian & Small decided to do something special as a holiday gift to their clients this year. Instead of sending a traditional gift such as wine or a gift basket, they decided to give a gift that's true to their mission of being "Nonstop Advocates" for the community. We designed a card to mail to their clients that contained a unique code. We created a special website, NonstopAdvocates.com, where the code can be entered to direct a gift to one of the three charities. The gift is then made in the client's name. The website features dynamically updating totals to show the real-time impact of the gifts. Clients can check back often at NonstopAdvocates.com to see the progress. This was a very rewarding project for Scout to be involved with. On a technical note: we used WordPress to power the site and PHP/MySQL to power the forms and code validation.

Clients choose what charities Christian & Small will donate to as their gift.

Clients get to read about the charities that they are choosing from and decide to give.

Clients will enter the code that they were mailed in this form.

Thank You Page

Nonstop Advocates also features what different Attorneys at Christian & Small are doing in the community. Keep checking in to read more about what they are doing as time goes on.

November 5, 2010

Video: “American Software” by Gianluca Fallone

From Partizan director Gianluca Fallone

Here is American Software, a short film inspired by the towering giants behind the American software industry. That is, if Steve Jobs was a rebellious punk rectangle, with guitar in tow, taking on King Bill through a rock-off within some parallel counter-realist 8-bit geometric vision of our world.

For more on Gianluca, visit

http://partizanlab.com/partizanlab/commercials/?gianluca_fallone

-

Gianluca Fallone: direction, illustration, animation, grade & post

Music by Ratatat (Sunblocks from LP4)

-

via The Post Family

Sara Cannon is a Design and Digital Strategy Consultant, UX/UI Designer, Creative Director, & Artist.
Have a project I could help you with? Contact me at sara@saracannon.com.

Skip to content