WordPress Experts: Getting Slug by Single_Cat_Title

An interesting problem that I came across in a recent project. The client needed a custom post taxonomy set to a gallery of choices on a featured section of their website. First we needed to add custom post types and category images plugins. Iterating through the taxonomy was a cinch but at one point I noticed that a few categories were not linking correctly. This is because we weren’t using the taxonomy’s slug but rather the name. After some searching we found this great little workaround to nail down the proper link. Slugs to the rescue!


 $cat = get_term_by('name', single_cat_title('',false), 'category');

 echo $cat->slug; 

 

http://codex.wordpress.org/Function_Reference/get_term_by

Perfect. Custom post types is a powerful tool but we’ve found a lot of weakness in terms of developing relationships between custom posts. Primarily when using CRUD – developing robust database relationships with WordPress is kind of a pain, not really there yet to replace the other options out there. I think this is because too many plugins and toolsets are gearing toward the idea of “no programming needed”  being a good selling point. Personally, it seems that just making programming easier would be the better option, rather than making a comprehensive alternative to programming. If you don’t know how to program, should you be programming at all?

More Web Design Blog Content

JW Freeman Plumbing Has A New Website

JW Freeman plumbing is a new client with lots of potential. He needs something that will put him on top and Livewire is that something. We have tons of experience and dozens of happy clients that proves we have the formula for success. We don’t keep it a

Messaging When Switching From iPhone to Droid

Sneaky little issue pops up when you move away from iphone. Other iphone users that previously texted you won’t be able to text you the same way once you switch. This is because when you both were using iphones, the messaging system was not the typical SMS, but

When To Get A New Mac

When To Get A New Mac

MacBook Running Hot and Sluggish? It Might Be Time for a New One If your MacBook Pro has started running hot, fans are constantly spinning, and everything from Safari to Finder feels like it’s stuck in molasses—you’re not alone. These are some of the most common signs that

Warrington Heating and Air Has a New Website

Warrington Heating and Air is a great company and they made a great choice coming to us for their website needs. Previously they had been with a company out of California. They were not happy with the results thus far. Their website was out of date, never worked

Photography Services

At Livewire we have not had photography services in the past, leaving it up to clients to procure their own services for website pictures. Over time, this has become an inconvenience. Mainly, waiting for images holds up the design process. We are so glad we found Kimber Greenwood

Review: WordPress Business Directory ★ ★ ★

[vc_row][vc_column width=”1/3″][vc_button title=”Where it’s at” target=”_blank” color=”btn-inverse” icon=”wpb_arrow” size=”wpb_regularsize” href=”http://codecanyon.net/item/wp-business-directory/2203258″][vc_column_text] ★ ★ ★ Features V1.8 Premium Membership (Paypal) Location Based Search Internationalization CSV Import with auto map location finder[/vc_column_text][/vc_column][vc_column width=”1/3″][vc_column_text] 3 Stars out of 5 This is a wordpress plugin We took off one point for poor style