WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[Plugin: Yet Another Related Posts Plugin] Post-Type, MarketPress and YARPP (13 posts)

  1. RandallFlagg
    Member
    Posted 1 year ago #

    Well, hello!
    I'm trying to use the YARPP plugin, but I can't get it to work with post-types.
    I'm using the MarketPress plugin, that what it does is create a post-type called "product". I'm trying to related my products with each other but I can't get it to work.

    It works like a charm for regular posts.
    I activated in the "Relatedness" the "display result from all post types" and nothing.
    I even added in the "register_post_type" 'yarpp_support' => true
    (as suggested here http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-making-yarpp-caching-feature-work-for-custom-post-types )And no result.

    The MarketPress works like a regular post-type, so there's nothing weird there.
    In the "other Notes" section got the yarpp_related doing this:

    yarpp_related(array(
     'post_type' => array('post', 'page', 'product')
    ));

    Nothing. Actually, the "yarpp_related" I really don't know how to use it! So I'm really puzzle here.

    Some help would be more apreciated!

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

    [ Please do not bump, that's not permitted here. ]

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry to hear the custom post type support isn't working for you. :(

    When you say you get nothing, do you mean you get "no related posts" or get no display? Do you get any posts or pages as related?

    It's quite possible that you need to lower your "match threshold", and that the algorithm is being too strict. Go to YARPP settings > Relatedness and lower the match threshold, update, and see if that helps. If you don't see the Relatedness section, you can turn it on in the "screen options" tab.

  3. RandallFlagg
    Member
    Posted 1 year ago #

    No. I guess the plugin should also work when I'm on the post_type write new post, right?

    Nothing there. Is like is not registering the post type =(
    And it's getting no result of matches :(

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry I'm a little confused. There seem to be a few issues here... let me confirm:

    1. you're not seeing the "Related Posts" preview in the post edit screen for custom post types? Have you checked in the "screen options" tab?
    2. Are you getting "no related posts" on the related posts display for these product pages?

  5. RandallFlagg
    Member
    Posted 1 year ago #

    Yes! (to all)
    It's like it's not seeing my custom post type.

    (Actually is the MarketPress plugin that uses the Custom Post Type...)

    Maybe you can try this by installing the plugin!

  6. RandallFlagg
    Member
    Posted 1 year ago #

    Here you can see what I'm saying
    https://www.dropbox.com/s/32xcoa6i4llwf8i/yarpp-example1.jpg
    And here
    https://www.dropbox.com/s/vn08mh8wxlheqqg/yarpp-example2.jpg

    It's like Yarpp it's not considering the post_type "product"

  7. RandallFlagg
    Member
    Posted 1 year ago #

    As far as I get, I gotta declare the yarpp_related somewhere... dunno where.

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    As for the first issue (the Related Posts preview not showing up) I'll look into this.

    The list of post types YARPP is recognizing is in "The Pool" options. If you don't see that, you can display it from the YARPP settings page. Products should show up there if you set 'yarpp_support' => true

    Keep in mind that yarpp_related overrides any such settings, though, so if you specify products in options to yarpp_related, it should work... what if you choose to display only related products?

    yarpp_related(array(
    'post_type' => array('product')
    ));

    What do you get then?

  9. RandallFlagg
    Member
    Posted 1 year ago #

    The `yarpp_related(array(
    'post_type' => array('product')
    ));`
    I put in the theme (in this case, sidebar?)

  10. RandallFlagg
    Member
    Posted 1 year ago #

    Sorry, I feel kinda lost with the documentation =(

  11. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    This code must be in The Loop: https://codex.wordpress.org/The_Loop

    To test it first, I suggest you put it in your theme right below the_content().

  12. uradvd
    Member
    Posted 1 year ago #

    I have the same problem with the plugin does not display related posts, use this code

    <?php
                    $post_id = get_the_ID();
                    yarpp_related(array(
                        'post_type' => array('product'),
                        'weight' => array(
                            'tax' => array(
                                'product_category' => 2,
                                'post_tag' => 1 // put any taxonomies you want to consider here with their weights
                            )
                        ),
                        'require_tax' => array(
                            'product_category' => 2,
                            'post_tag' => 1 // for example, this requires all results to have at least one 'post_tag' in common.
                        ),
                        'threshold' => 1,
                        // Display options:
                        //'template' => 'thumbnail', // either the name of a file in your active theme or the boolean false to use the builtin template
                        'limit' => 5, // maximum number of results
                        'order' => 'score DESC'
                            ), $post_id, true);
                    ?>

    No related posts :(

  13. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    @uradvd nothing in your query seems wrong to me... are you sure there are enough related products for your post? What if you remove the "require_tax" section?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic