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

Some Homepage Best Practices

Building an effective website begins with a well-designed home page. Because it’s the first thing people see, the homepage must make a nice impression while also pointing the user in the right direction. If you want your homepage to be successful, you should follow these guidelines. Make sure

SEO is No Big Secret

Really, SEO is not some big secret. Some companies try to pretend it is but you don’t have to be an expert to manage your own SEO. What do you think search engines like Google want? Well, they want what their users’ want. That’s how they get business,

Fraternity Management Has a New Website

Fraternity management needed something up quickly and something that was affordable. Glad to know that they chose us as their Gainesville Web Design team.  Additional to the website they requested a simple program that managed their payment modules. As experienced PHP developers, we were able to quickly put

Budding Biologist has a new website

A cute website for a really neat childrens’ book series by budding biologist. Their new website is responsive, meaning it is mobile ready and will display correctly across all devices and all browsers. Integrated web store and using the latest in HTML 5 and CSS3 media queries. Cloud

Not All Backlinks Are Created Equal

Improving SEO Results with Link Building. Still trying to get higher SERP (Search Engine Results Page) placement? After months of trying is your company no higher on Google or Bing than before you concentrated on SEO keywords? The lack of results from your efforts may leave you confused

Database Projects

We are database junkies. Simply put, you can’t beet the flexibility and scalability that databases offer us in the web design world. We prefer using MySQL which is the most common database for web projects. It integrates with PHP perfectly and together there is simply nothing more powerful.