Home » Experts Only » WordPress Experts: Getting Slug by Single_Cat_Title

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?

What’s New For 2015

Really, we’re not all that sure. We’ll go where the winds blow us but we do have some exciting projects to start out the year right. January will be a big month for us here at Livewire and we hope it only goes up from there. We’re glad

Preloading Images with Jquery

There are times when preloading images is an important step in keeping your site/page/program running smoothly. This is especially true in the era of mobile. Here’s a cute little snippet that does just that. function preload(yourarrayOfImages) { $(yourarrayOfImages).each(function(){ $(‘<img/>’)[0].src = this; }); } preload([ ‘img/image1.jpg’, ‘img/image2.jpg’, ‘img/image3.jpg’ ]);

Using Google URL Shortener

It really could not be easier. Google’s URL shortener is certainly the best one out there. https://goo.gl/ Our latest rollout, InfoGopher, uses this extensively. Our unique texting app needs short URLs in order to remain inside text character limits. Anyway, we love it. Google as usual gives you

The Flour Pot Bakery has a new website.

NEW!! Sally is one of a kind and so is her business. She really takes the time to put out a quality product and we wanted to give her that same high quality standard with her website that she is used to. FPB has some fantastic bread –

Small Business Sees A Rise In Cyber Threats

Come on, let’s all live in the real world: we’re all vulnerable. Really the only chance you have these days is to make it as difficult as possible for any potential hacker to get to your valuable data. First and foremost this means protecting your data in transit.

The problems with Wix

Wix is a do-it-yourself website builder. While this may seem to be in direct competition with Gainesville Web Design companies, they fill an important niche; mainly, those customers that cannot afford a professional website but still desire to have a nice looking design for their business. The templates