WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] YARPP and Custom Post Type with Types/Views (3 posts)

  1. battra
    Member
    Posted 1 year ago #

    Just want to post the solution of integrating YARPP and CPT created using Types. Quoted from their support forum:

    Please try Types fiter hook "wpcf_type", like this:
    add PHP codes in your theme/functions.php

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

    Please replace "my-post-type-one" and "my-post-type-two" with your custom post type slugs

    This works for me and I can see my custom post type checkbox in YARPP setting page. HTH!

    Source: http://wp-types.com/forums/topic/related-posts/

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

  2. jeffparker
    Member
    Plugin Author

    Posted 12 months ago #

    Glad that worked for you, battra!

  3. nemoprofeta
    Member
    Posted 12 months ago #

    Thanks for the code. I tried it on a blog using Custom Post Types UI but it didn't work. Should it work as it is or should I modify it?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic