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?

More Web Design Blog Content

CSS Evolution

Cascading Style Sheets, or CSS revolutionized the way the web was/is written. The next evolution has been the roll out of CSS3. With all kinds of new tricks, CSS3 promises to take web programming to the next level … and beyond. We generally hand code all of our

What’s Worse?

What’s worse than these dang North Florida love bugs? Having a poor website, for one. A website should be like the dream employee . It should never call in sick, treat your customers properly and get them the information and the attention the require each and every time.

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

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

Submit A Sitemap … To Bing?

Indeed. For some reason, Bing still exists. And since it does you’ll need to submit your sitemap so your business will show up in the results of a person who searches from the unwanted automatically installed Bing bar on their browser. They’re so lovely, forcing it on you

Northwest Seafood has a new website!

Thanks to our killer Gainesville Web Design another Gainesville company has joined the livewire family with a brand new website! It’s wordpress so we can’t take credit for the design in it’s entirety but the layout is great and they’re very happy with the finished product. Their original