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 add a simple piece of code in your functions.php file.

add_filter('wpcf_type', 'yarpp_support_func', 10, 2);
function yarpp_support_func($data, $post_type)
{
 if(in_array($post_type, array(
 'your-custom-post-type',
 )))
 {
 $data['yarpp_support'] = true;
 }
 return $data;
}

This is a handy little solution. Simply replace ‘your-custom-post-type’ with the slug of your CPT and you’re in business. Now related posts show up just fine and you can take advantage of all the great things YARPP has to offer! Custom programming has never been easier with WordPress.

More Web Design Blog Content

Gainesville Web Marketing

North West Mini Storage and Warehouse is a new client of ours. We started optimizing their site about 3 weeks from the date of this post. Already a page 1 contender, our client now enjoys a surge in search engine traffic – all organic, all of it white

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

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

Garry Seay has a New Website

Garry is running for Sheriff in Union county Florida. We wish him the best of luck and he has a great new website to show off. His campaigners came to me after locating Livewire on Google. We met and discussed their needs. They needed something up and running

Using Red In Website Design

A key component of website design is color, and many designers choose the color red in particular. Red is a passionate, vivid color that may elicit strong feelings and emotions, making it a fantastic choice for designing a strong, compelling website. These are several justifications on why red

Sullivan Welding Has A New Website

Sullivan welding does excellent custom welding and fabrication. Willum is the owner and manages a crew of expert custom welders. He came to Livewire looking for the best in Gainesville Web Design and we were able to set him up in a great new website in just a