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?

Gainesville Website Design: Mobile Websites

Mobile sites are a great way to tap into a new resource for many businesses. More and more people are using their phones as their primary device for Internet access. Phones are more computers than they are phones these days. A mobile website is a lightweight version of

gainesville website SEO company

✈️ New Website Launch: University Air Center Soars to New Heights Online

We’re proud to announce the launch of the new and improved website for University Air Center — Gainesville’s premier full-service FBO, flight training, and aircraft maintenance hub. With a sleek new design and streamlined navigation, the new uac.aero offers pilots, students, and aviation professionals a faster, more user-friendly

How To Survive A Good Google Dinging

This is a great demonstration of what can happen with unnatural linking schemes and getting hosed by using link farms. This company did some black-hat SEO and it came back to bite them. Luckily the article shows that it is possible to recover from a Google update nightmare, but

The Importance of a Professional Website for Gainesville Businesses

Gainesville is a vibrant community known for its strong local economy, driven by a mix of education, healthcare, and a growing number of small businesses. As a business owner in this dynamic environment, establishing a solid online presence is no longer optional—it’s essential. One of the most critical

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

Don’t Think Page Load Times Matter? Think Again.

A recent study by Google really hit home for online retailers or anyone looking to make a sale/conversion online. As Forbes points out: “53% of mobile site visitors will leave a page that takes longer than three seconds to load.” Google’s recommendations usually hover around one to one