Gravity Forms – 5 Digit Zip Codes & State Abbreviations

Originally based on the code by Matthew Connerton on the Gravity Forms support site, I have modified his original code to also trim the zip code into the first 5 digits. Currently with Gravity Forms, there is no (easy) way to change the input fields to only accept 5 digits (or any other number) and/or change the submitted state selection to their USPS equivalents. If you're trying to use your data to generate mailing labels or anything similar, the way it is setup can be messy and/or problematic. Hence, the solution Mr. Connerton, and now myself, have developed. It is written as a plugin so all you have to do is download the file below, unzip it and put it in your WordPress plugins folder. It will then modify the submitted entry prior to it being saved to your database, and BAM! You're a happy camper. So what does this plugin do in short? -

  • Trim submitted zip codes to 5 digits
  • Convert full state names to their USPS state abbreviations
Enjoy! > State and Zip Code Modifier for Gravity Forms (7288) Note: the link to Gravity Forms only works if you're logged in to their support forums.

Weather Underground Plugin Expansion

My favorite Denver SEO company Katz Web Services announced the release of their latest awesome plugin- WP Wunderground Plugin. It's a well done, awesome plugin that allows you to use short codes to display the weather forecast in a widget or blog post. For one of my clients however, we wanted the weather to be a part of the theme outside of a widget. A small bit of code later, it's done. You can see the weather forecast for Roanoke, VA by clicking that link. We installed the WP Wunderground Plugin and then added this bit of code to our theme file: 1 Now, an explanation of what you see. Line 2 is a conditional statement checking to see if the plugin is currently active by checking to see if the plugin's class exists. It wouldn't exist if the plugin was active. You could also use the WordPress function is_plugin_active() but I've run into a couple of instances where it returns an unknown function error. Lines 3 & 6 are simply creating a container «div» for styling purposes. Lines 4 creates a new instance of the plugin class and Line 5 prints the result of the internal method build_forecast(). The '24012' is the zip code I want the weather returned for and is also defined in the plugin settings. Enjoy!

Get Your WordPress Multisite Blog Slug

I chose this subject to write about for two reasons. One: I'm sure there are folks out there who will find this useful. And Two: I can never remember it myself so by writing about it here, I won't have to remember, I can just refer back to my own blog! Often, when using WordPress multisite as a content management system rather than a blog network, I have the need to use a blog slug in image paths, or when doing DB queries or whatever. There are lots of reasons, but here's how you get it > 1 I find the $GLOBALS variable to be really useful. If you'd like to see all the stuff you can get out of there, just drop this line in your theme somewhere (it's quite long, so best not to do it on a production site)- 1 Enjoy!

New WordPress Plugin: Stardate

On September 8, 1966, Star Trek debuted in the United States on NBC. To honor the 44th anniversary, we have coded and released a novelty plugin for all of you Trekkies out there. The Stardate Plugin offers three core functionalities, the coolest of which is first:

  1. You know that publication date that shows up on your posts and pages? Change it from the traditional calendar format to a STARDATE. Oh yes.
  2. Use our fancy shortcode to insert the current stardate in a post or page wherever you like.
  3. Use our awesome function to integrate the stardate into your theme template anywhere you like.
Here it is in action:

Today's Stardate is 12412.22

You can download the plugin from the WordPress repository here. More information can be found on the official plugin page- Stardate.

WordPress Gallery Shortcode

Apparently this little gem has been around since WordPress 2.5 (and as of this writing we're at 3.0.1) but I'm just now finding out about it. Good grief!

Gallery Shortcode Tutorial

So you want a fancy WordPress gallery without having to install a gallery plugin? Yes, you can do that. Easy. It's as simple as the following steps:
  1. Start a new post (or edit an existing post)
  2. Using the "Add an image" icon next to "Upload/Insert" above the WYSIWYG editor, add the images you want to display as a gallery on your post. This is technically attaching images to the post.
  3. Wherever you want your thumbnail gallery of images to appear, add the shortcode- [gallery]
And that's pretty much it! Easy right? I told you so!

Gallery Shortcode Options

The [gallery] shortcode also has other options available naturally if you want to customize your WordPress gallery. The basic options are pretty straight forward and include- columns, id, size. [gallery columns="2"]
The columns options, as you might imagine, sets the number of columns the gallery will have. The default is 3 if you don't specify a value. If you set columns to 0, row breaks will not be included in the output. [gallery id="911"]
The id option allows you to pull images from a different post. So if your image gallery you want to display is attached to another post, rather than reupload all those images, just specify the post id of the original post and you're in business. [gallery size="large"]
The size option allows you to choose what image size you want to use in your gallery. The default is "thumbnail" but you can also choose- medium, large and full. (Those sizes of course are the image sizes in your gallery that your image is resized to when you upload, except full of course, which is the original image size.)

Gallery Shortcode Advanced Options

There are some other advanced options as well that let you control thumbnail order, including or excluding particular images from the gallery and XHTML output. If you're interested in those, I recommend you check out the WordPress Codex.

Gallery Shortcode Example

I uploaded a few photos to this post myself to show how this works. So without further ado, here's an example of the gallery shortcode. For the above gallery, I just used [gallery columns="2"]. Hope you found this as interesting and useful as me! And all these photos are copyrighted. :)

WPMU Sitewide Tags – Posts don’t show up?

I'm working on a new WordPress Mu site and am using Donncha's fantastic Sitewide Tags Plugin to pull all the posts from across my network of blogs onto one master blog for indexing features across my site. One thing I didn't realize however was that (at the moment) it only works on posts published AFTER you start using it. If you're like me you have 100s or 1000s or even more posts already in your network. I stumbled across some code the other day that will iterate through your blogs and pull the existing posts into the new tags blog. So Colas Nahaboo, whoever you are, thanks for this awesome bit of code: 1 The easy thing to do, is using the WPMU Power Tools plug-in, from Brian Freeman, run the above query exactly as it is across all blogs and within a few seconds all of your posts will be pulled in. Easy! Thanks to Andrea and Donncha for tips over the past few days, I always appreciate the help.

WPMU Site-wide Breadcrumbs

Kudos to Dimox for a great non-plugin WordPress function for creating breadcrumbs. For someone like me though, who is implementing a WordPress Mu site using "blogs" as content sections instead of the traditional community of blogs, I'd like to be able to have breadcrumbs that go more like this- Home (root uri) » Blog Home (blog uri) » normal breadcrumbs To accomplish this, I just made a few modifications to Dimox's code and with the power of WordPress, Shazam!, it was done. Here's the chunk of code I added/modified (note, this code goes in your themes' functions.php file): 1 And that's it, now just do everything else as Dimox suggests on his site. Enjoy!

Events Manager Plugin – Hack to display events by categories

I have a client who uses the Events Manager plugin by Davide Benini and Marcus Skyes to manage events on their site. Unfortunately, the plug-in doesn't let you display events by category (which is weird, otherwise, why have the categories?) but anyway, I wrote/hacked together a custom function and WordPress shortcode today to display the events by category. Now, I know there are going to be the naysayers who say "This code isn't very pretty".  Yeah, well maybe not but it works.  And if you can improve on it, DO!  I'm totally open to it.  For instance, the edit I did makes more than one query to the DB which isn't optimal. Okay, so without further ado, here it is. Open up the file in your events-manager/ folder called 'marcus-extras.php'.  Around line 264 you'll find a function called dbem_get_category().  I added my custom function and shortcode right below it : 1 And then: 1 The shortcode is - [dbem_events_by_category] and you can just insert it into your post or page whereever you want it to go. By default it outputs ALL events under ALL categories but you could hack it up pretty easily to only display one category, etc. I may do that later if enough people ask for it but it's not what I needed so, didn't get done. :) Hope this helps some folks. Let me know if you have any questions!

Follow Friday Test

Here is a list of people to follow on follow friday from people that i follow and who also follow me. Tired of those laundry lists? These are recommendations, not just retweets... Here were the instructions: Come up with a list of people you recommend for follow friday. Make a list of people you really interact with and a short blurb about why u follow them. 140 chars per description max. @mosquitohawk #followfriday #1 I follow @RavenJon because he has an awesome SEO toolset (@RavenTools) & is an all around nice guy with sharp spidy sense. #2 I follow the hip @JoannaLord because she's witty, has great taste in music & is a great contributor of social media & search knowledge. #3 I follow the brilliant @steveplunkett because when he talks SEO tactics, you better be taking notes. Where does he get those great tidbits? #4 I follow @jrcornthwait - He's king in the land of HTML emails (& has good taste in food, design & isn't afraid to call it like he sees it). #5 I follow @carondelet of the Brute Squad because there's always something to be said for someone who can exchange obscure movie lines w/ you. #6 I follow @lookadoo because she cares. I also can't wait to meet her in person at some future conference. Smart, motivated & entrepreneurial. #7 I follow the ever-present @ShanaTweeting because she's a social media guru and always has good insights, blog posts and thoughts to share. @steveplunkett #followfriday I follow @kimsherrell because she is an intelligent person who adds value to your twitter stream. I follow @cyandle because he is my twitter homie.. #seo #ppc I follow @zerbetron because she's got that Boom Boom Pow and she is a fellow webmaster chair dancer. I follow @melyssatweeting because she has a good brain. I follow @jackleblond because he's a good man, no b.s. yet open minded, good sense of humor and sometimes he even posts some cool recipes. I follow @mandaotto because she is real and smart, and an amazing artist. I follow @martinbowling because he has a great sense of humor, he's quite intelligent and crafty. I follow @lookadoo because she is a great friend, a good voice of reason and wisdom. I follow @mosquitohawk because he has a good sense of humor and an interesting viewpoint. I follow @dannysullivan because he is the walter cronkite of SEO. I follow @blueyedmuse because she is smart, funny and tweets good stuff. @zerbetron #followfriday #followfriday For the best in geekery & nerddom, I recommend @geekgirldvia. She's smart, funny, & knows enough about BSG to be dangerous! #followfriday A nerd in search of love? Worry not! @geeksdreamgirl helps nerds & geeks find their perfect match. Super nice and lots of fun Interested in SEO & Social Media? Follow @cyandle. Great guy and he's always got fun and exciting things to say. He rocks! #followfriday If you do SEO, & you're not following @steveplunkett, you should get your head checked! He's an SEO Jedi Master. #followfriday @MichelleRobbins is a SEO smarty-pants, BSG nerd, super smart cookie & all around nice gal. I love her tweets & you will too! #followfriday @lookadoo #followfriday Learn all you need about Online Reputation Management & best practices in online marketing from @andybeal. His training classes kick it! Get blogging, WordPress, SEO & many tech tips from @DazzlinDonna. Donna's stream is like tapping into a business marketing coach! Just received my autographed copy of "What Success Takes" by @garrettpierson! I had the honor of reviewing his book, changed my approach! I am in debt to @pageoneresults for 2 hours of his SEO consulting time! I'm wiser & now broke! "Web Standards" should be his middle name. Friendship & geekship combined, @professor is the genius behind @Blogsville. Don't miss out on this blogging lineup! @GlobalFusion is more than a specialist in Spanish SEO, he's a thought leader. Admire his wisdom, approach & ethics in SEO. I've learned a lot about using Social Meda sites from @BrentCsutoras. He knows the insides of StumbleUpon, Reddit, Digg! Add SEO, too! The Social Media Queen is @TheNanny612! Don't tell, but I have a #girlcrush on her! Obsessed w/the science of search, @SEOdojo speaks to SEO geeks & wannabe-gurus! Reading his newsletter is on my TO DO list! One of the youngest & earliest prodigies I've followed is @PluginID. He knows how to make money blogging & will show you how, too! I started reading Barbara Rozgonyi @wiredprworks before Twitter. She's become a friend and PR mentor! If I had children, I would homeschool using Montessori lessons by @loribourne. I met her on SEOmoz & the friendship optimized from there! Forget music! I tune in to the latest in search marketing on @WebmasterRadio @BrascoAtWMR is more than a radio genius! <3> Get the latest analysis in search from @BruceClayInc by listening to @SEMSynergy every Wed! They translate SEO into understandable tidbits. @Remarkablogger shares blogging, tech & SEO tips. His insights convinced me to learn Thesis, so here I am with a new theme to learn! @martinbowling #followfriday @oilman cause he always has some wild adventure @persianwiki providing a great look at what's really happening on the streets of iran @oncee IT Manager in Charleston, WV always tweets awesomely helpful info @jordankasteler has awesome insight to using social media in creative and new ways @davesnyder it's BIG DAVE nuff said :) @rfr an incredible gifted designer, he <3's> @mandaotto #followfriday @graywolf a great go-to for all things seo @tonyadam all around great yahoo guy @cshel another very smart seo gal @shanatweeting great social media expert @melyssatweeting #followfriday @VegasWill A great follow. Tweets all signal and no noise. @FoundByPat Super Dad. Really relevant tweets. Exceptional wit. @StevePlunkett Everything’s bigger in Texas – including his brain and the strength of his tweets – fun follow. @cyandle #followfriday @sspencer - his presentations always provide so much information for the audience... @rustybrick - one of the top bloggers in the IM industry.. @dannysullivan - the father of seo; and always keeps his tweeple up-to-date.. @copyblogger - one of the top bloggers in the IM industry.. @oilman - always willing to help out other when it comes to learning new IM stuff i.e. paid links.. @StoneyD - always provides in depth posts regarding IM checklists.. @katemorris - great at PPC... @yoast - always on top with his wordpress plugins.. @TheMadHat - can make a mean bacon explosion.. @streko - king of the porkroll.. @melanienathan - she knows her linkbuilding.. @davidmihm - great at teaching us local search.. @theGypsy - great at keeping us up-to-date on patent info.. @shanatweeting - even though she's a mega phillies fan you can tolerate her.. :) @professor - great at development work.. @davesnyder - knows his social media...and likes to cuddle from what i hear.. @graywolf - if i need a mean cake he could do it.. @Pamela_Lund - if you need custom USB flash drives she can hook u up.. @sugarrae - knows her affilaite marketing stuff.. @BrentCsutoras - knows his social media... @andybeal - great online reputation mgt expert.. @brianchappell - knows his social media & online reputation mgt.. @yummyman - great at teaching us local search.. @lookadoo - a great all around person to follow.. @pearsonified - thesis king.. @bbille - always willing to help a brother out.. @pageoneresults - sphinn's worst nightmare.. @JoannaLord - knows her PPC.. @wiep - master link baiter.. @GymJunkies - can pump u up.. @steveplunkett - mad IM scientist.. @martinbowling - great at development work.. @SmokinManBBQ - it always tastes better when the smokinman' cooks it.. @itcn - can develop some great stuff.. @styletime - great at designs and wordpress..

Official Cool Guy of the Day award

Cool Guy of the DaySo I have been honored with the distinction of "Cool Guy of the Day" from the ever-so-friendly and über-cool Brandy Eddings and cohorts. What do you need to win this award?  My suggestion: an unusually strong grasp of obscure modern, 80s and 90s trivia and info.  Knowing who this guy is helps too. Also, special thanks and props to Zule and the Keymaster (split personality is rampant in Dallas lately) for their vote as well.

    • Marty has been an active search marketing professional for over 12 years. He has consulted with the Fortune 100 and Fortune 500 as well as medium to small B2B and B2c businesses, governments and higher ed.