Quantcast
Viewing all articles
Browse latest Browse all 119468

binfil on "[Plugin: Yet Another Related Posts Plugin] Making YARPP caching feature work for custom post types"

I was using yarpp_related( ... ) option in order to show the related posts for a custom post type. I realized that the items displayed were not going through the caching mechanism.

I could not find a clear/simple explanation elsewhere so I am posting the solution I came up with.

So, If you want to make the custom post types work with caching:

Add 'yarpp_support' => true to your functions.php

register_post_type('myCustomPostType', array(
    ........
    ........
    ........
     'yarpp_support' => true
    ));

Now you will see your custom post type name in the settings section -> "post types considered"

In your template file, use

<?php related_entries(); ?>

Voila!

http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/


Viewing all articles
Browse latest Browse all 119468

Trending Articles