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

New Website for NWSF!

Northwest Seafood got hacked unfortunately. Being previous clients of ours we came to the rescue. The site was damaged beyond repair so our team of Gainesville Web Design experts took hold and gave them a brand new website in a matter of days. We always support our clients in

What makes your website attractive to google?

What makes your website attractive to google? In 2013, Google released Search Quality Evaluation Guidelines to provide transparency in how google rates websites. The main goal of Google’s Search Quality Ratings is to provide results that represent and are beneficial to a specific user and their locale. This

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

Facebook Ads V2

Still debating whether or not to use facebook ads? The short answer is you just have to put something out there to get the data back in order to determine if it gives you that ROI or not. Facebook’s network is extensive and the major benefit of advertising

Review: PHP Live Chat ★★★★

4 Stars for this chat system from GNTStudio. It’s quite useful and very easy to install. We’re actually planning to use it on our own website we like it so much. They lose one star because we had to modify a bit too much to get things to

How important is color in web design?

Color is an extremely important aspect of web design. It can have a significant impact on the user’s perception of a website, its brand identity, and the overall user experience. Here are some reasons why color is important in web design: Branding: Colors can be used to create