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?

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

web design ocala fl

Why Local Web Design Matters for Your Ocala Business

In today’s digital age, having a professional website isn’t just an option—it’s a necessity. But not all websites are created equal, especially when it comes to local businesses. If your business is based in Ocala, FL, choosing a local web design company like Livewire can make all the

Add YARPP to Custom Post Types: WordPress

A great little plugin for adding related posts to your blog has been around for a while: YARPP, Yet Another Related Posts Plugin. It’s fairly robust, for being free, but it does not natively support custom post types – a bummer. A quick way around this is to

Content Marketing Mistakes That Derail Your SEO

Don’t fall into the trap of content which won’t rank on search engines to go along with your sites top-flight graphics. All the effort and money poured into your website is for nothing if you don’t rank on a search engine. These are some common mistakes that can

Should you be wary of SEO firms?

Good Call Commander! You should absolutely be suspicious of SEO firms these days. The industry is unfortunately saturated with unscrupulous, downright devious companies that prey on  unsuspecting business owners attempting to better their rankings. They pump your site full of fluff and post thousands of links around their

New Mobile SIte

Head on over to livewiregeeks on your mobile device It’s our new mobile site based on Chalis iwebapp – a powerful framework that works well across the board. Livewire mobile has everything our main website has but is built for mobile devices. A custom redirect script detects whether a