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.

Google Local

In today’s digital world, it is essential for businesses to have an online presence. Google Maps is one of the most significant tools for local

Read More »

Starter Websites are Cheap

We’re offering ‘starter’ websites for as little as $175 in the coming months. This will get you everything you need, including shopping cart, to start

Read More »