Home » Experts Only » Add YARPP to Custom Post Types: WordPress

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

Pretty Awesome Image Packages

Nowadays, it’s just best to buy your images. As Gainesville Web Design experts, we purchase them almost on a daily basis. There are always projects that require different photos, icons or footage. Generally people purchase credits and then use those to buy images – kind of like an

What’s New For 2015

Really, we’re not all that sure. We’ll go where the winds blow us but we do have some exciting projects to start out the year right. January will be a big month for us here at Livewire and we hope it only goes up from there. We’re glad

Another Mouse Burned

This makes my 7th mouse in less than 18 months. incessant clicking has it’s consequences … and costs …..

Jquery Simple Fadeout

A cute little snippet to show a simple green bar upon a successful edit. <?php if(isset($_GET[‘edit’])){ ?> <div id=’notifyy’> Edited Successfully </div>     <script type=”text/javascript”>     $( ‘#notifyy’ ).show(function(){     $(this).fadeOut(5000);     });     </script> <?php } ?> The CSS: #notifyy{width:100%;background:#2f5001;padding:4px 15px;color:#fff;} Always,

WordPress: Capturing Post Author Meta

An easy one here from your local Gainesville Web Designer: How to retreive the author information from a post in the WordPress loop. This assumes you’re in the loop, of course. $meta_field= get_the_author_meta( ‘your_meta’ );   Badda-bing badda-boom. You’re done. It really is that simple. Just use get_the_author_meta,

The Brief Business Guide To Instagram

Instagram is a misunderstood product for most business owners. Isn’t facebook enough? No. Unfortunately you must not only adapt to the changing social media platforms but you have to keep adapting to all the various forms of networkings online. For some it’s fun, for others it’s a necessary