Blog

Responsive drop down menu with CSS media queries & jQuery

Or in other words, display a custom (mobile?) menu at a user defined breakpoint. So the steps are 1)Detect browser window size onload 2)Apply appropriate menu 3)Monitor window size 4)Apply appropriate menu at breakpoint How we’re going to do it 1)Detect window size with CSS media Queies and jQuery onload 2)Apply add CSS helper class […]

Retrieve all image attachments for a WordPress post

I use this a lot. Typically becuase I have some sort of custom write panel that allows the user to upload mutiple images, attach them to the post and then said images populate a gallery – or something along those lines. Get the “posts” Image attachments are just another type of  “post” within the data […]

Custom Taxonomy Breaks Permalinks

No kidding! Chances are if you are reading this you’ve done some head scratching on this topic.I’m willing to bet the problem is you’ve changed somtheing in regards to your custom taxonomies and  a rewrite setting is persisting, thus pulling a 404, when you navigate to an archive page of said taxonomy(s). This was my problem. […]

Custom WordPress Post Titles

It’s sometimes desirable to set a “maximum title length” so your theme doesn’t break when a user decides to use a ludicrously long post title. So filter the_title(). [code] function the_titlesmall($echo = true, $before = ”, $after =’…’, $length) { $title = get_the_title(); if ( strlen($title)>$length ) { $title = substr( $title, 0, $length ); […]

Add a color picker to your WordPress theme options page

This is by request and quite frankly quite simple. The following builds on  “Multiple upload inputs in a WordPress theme options page?” If you theme options page is constructed in a different manner, it’s still possible this will still be of help. First, get the script I like jscolor. It’s simple, lightweight and real easy to use. […]

Multiple custom buddypress avatars

I while back I wrote blog on custom buddypress avatars. A commenter asked about using more then one avtar. Hmmmm, good idea! Simple solution? Sure! We got that. Create your avatars And name them something like: my-avatar-1.png my-avatar-2.png my-avatar-3.png And so on for as many as you’d like. Mix it up [code] function myavatar_add_default_avatar( $url ){ $randomNumber […]

Bad value category tag for attribute rel on element a

Until HTML5 is finilized, the validator is really “experimental”. So in the mean time, we’ll all have to live with things like this. If you must have the little green check there is a clever way to get around this. Just a friendly reminder that you can pass the str_replace function an array as the […]

Multiple upload inputs in a WordPress theme options page?

WordPress settings API Lots of info and tutorials on the net on the subject of WordPress “theme options” or  “admin” pages. Many of them are out dated and don’t subscribe to the current best practices as outlined by WordPress – in other words the settings API. Nettuts is always a great place to start. In […]

Best way to embed non-flash video?

Video is a bit of a sticky wicket when it comes to web development. There are a number fo different approaches, all of wich have drawbacks. As of  WordPress 3.3.1 there is nothing built into the core that allows easy video embedding via the post editor. The following are the most common ways to embed video. See […]

Duplicate Titles with Yoast’s WordPress SEO Plugin

This is a ‘problem’ that’s perpetually swirling around the WordPress support forums. Here’s just one example.  I’ll be honest, I haven’t thoroughly combed through the code that hooks into the title and outputs the new “Yoast title”. I will however say, it works perfectly on many, many sites I’ve been using it on. That being said, for each an […]