WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] Custom Post Type Support (23 posts)

  1. Derek Perkins
    Member
    Posted 2 years ago #

    Mitch,

    I have been very impressed with YARPP and have used it religiously on my sites. I have also been watching very closely as custom taxonomies have been added and more importantly for me, approaching support for custom post types as well. In the 3.4.3 changelog, you mentioned "More custom post type support infrastructure"

    In previous posts, you pointed to a trac ticket that hasn't been updated.
    http://plugins.trac.wordpress.org/ticket/1142
    http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-custom-post-types

    I'm just curious, do you have any sort of roadmap or timeline for including custom post type support?

    Thanks,
    Derek

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

  2. hnikfazan
    Member
    Posted 2 years ago #

    I really would like this functionality as well.
    This is a great plugin that works like a charm.

  3. onepack
    Member
    Posted 2 years ago #

    I don't want to stop using this great plugin but I have about 8 custom post types and the reserved square for Yarpp is scary empty on all of these. ;-)

    Any update?

  4. onepack
    Member
    Posted 2 years ago #

    My idea in single.php to show related content in custom post types because in my case the custom post types are like a sort category/ topic and are kinda related. Not as good as YARPP but it's a temporary fix for me.

    <?php $myposttype = get_post_type( $post->ID );
    					if ($myposttype == post){
    						related_posts();
    					}else{
    
    					$the_query = new WP_Query('post_type='.$myposttype.'&post_status=published&posts_per_page=7&orderby=post_date&order=desc');
    			        if ($the_query->have_posts()) { ?>
    			        <ol>
    			        <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
    					<li><a href="<?php the_permalink(); ?>" rel="nofollow"><?php the_title(); ?></a></li>
    			        <?php endwhile; ?>
    					</ol>
    
    			        <?php
    					 }
    					} ?>
  5. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    YARPP 3.5 introduces custom post type support. Please download YARPP 3.5b4 and check out its readme.txt for details.

    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.5b4.zip

    I also recently gave a talk on this. Here are the slides:

    http://www.slideshare.net/mitcho/relate-all-the-things

    Please do let me know if you run into any issues with CPT support. I'm hoping to release 3.5 soon.

  6. Eizil
    Member
    Posted 2 years ago #

    When i try to use the yarpp_related() function, seems no articles is being shown, and no message (no related article) been echoed.

    i just use the CPT function call.

    <?php yarpp_related($post->ID, array(
                      'post_type' => array('mycustompost'),
                    )); ?>
  7. Eizil
    Member
    Posted 2 years ago #

    okay, I think i found out the reason why its happening, the function request for $args first before the post id, i changed the sequence and its working correctly now.

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    Ah, thank you! This was wrong in the docs but I just updated it for version 3.5. :)

  9. dannoll
    Member
    Posted 2 years ago #

    If I have a custom post template, can I display related posts on it using YARPP infrastructure? (I read the readme for 3.5b4 and it suggests that I cannot, but I wanted to confirm.)

  10. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    @dannoll, if I understand what you're asking correctly, this is possible. Check out the detailed instructions on CPT support in the latest readme.

  11. Misamee
    Member
    Posted 1 year ago #

    Why custom post types aren't listed directly in the settings page?

    "The pool" shows which posts type are considered.
    By default they are posts and pages.

    This list could show all custom post types and could change in a checkbox list where users can select what should be used to indexing related posts, easing the life to many people (see no coders).

    Thanks.

  12. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    CPTs are in general created using at least some custom coding, so I don't think the extra line of code to add YARPP support is asking too much. If you add 'yarpp_support' => true to your CPT definition, it'll show up in those settings.

    Making all custom post types (non-builtin post types) show up and included in the YARPP pool would have various unintended consequences in many environments, where custom post types are used as a general data store for various applications.

  13. Misamee
    Member
    Posted 1 year ago #

    I used to define CPT by code, but found handy the use of other plugins (like WP-Types, for instance).
    I've also noticed that a lot of people does the same and I don't think that "CPTs are in general created using at least some custom coding" is a completely exact statement.

    However, I didn't even ask to have these CPTs enabled by default, but just listed in the Pool pane, along with a check box to enable them.

    It's just a matter of usability: people that use a plugin to define their CPTs wouldn't be able to add the yarpp_support on their custom post types.
    Just that.

    Thank you anyway for the answer.

  14. amit@m-web.com
    Member
    Posted 1 year ago #

    Hello Mitcho,

    I am struggling to show my posts from my COSTOM tags/taxonomies. Can you explain in brief where i need to add "yarpp_support' => true" (which explained above) to show it up in the settings area.

    Please let me know if possible...asap.

    Thanks,
    Amit

  15. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    @amit when you call register_post_type( $post_type, $args ), $args will be an array. Make sure that array has a yarpp_support key which is set to true. Does that make sense?

  16. amit@m-web.com
    Member
    Posted 1 year ago #

    Hello Mitcho,

    Thank you so much for sparing time from you valuable schedule to reply me.

    Yes, your help did show some required output at the YARPP settings panel but the frontend started showing following improper redirect message when I am trying to view any post to check "Slider" in action -
    ********************************************************
    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept
    cookies.
    *********************************************************

    Please suggest me how i can enable custom support without any error or issue.

    Once again thank you very much for considering my question to reply.

    Thanks,
    Amit

  17. amit@m-web.com
    Member
    Posted 1 year ago #

    To add more info:

    In my case i am calling the suggested function like this register_post_type( 'investment-idea', array('yarpp_support' => true) in functions.php file. Earlier it was like register_post_type( $post_type, $args )

    Please help!

  18. amit@m-web.com
    Member
    Posted 1 year ago #

    Hello Mitcho,

    I actually understood what you were saying and when I corrected that, it starts picking what I wanted.

    Thanks a lot for your kind help!

    Regards,
    Amit

  19. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Glad you resolved this. What was the problem?

  20. amit@m-web.com
    Member
    Posted 1 year ago #

    Sorry for my late response!

    Actually i wan not defining 'yarpp_support' => true parameter at the correct place and that is why it could not pick the custom tag. Now YARPP is working flawlesly and helping me in getting some traffic :)

    Thanks a lot!

    Regards,
    Amit

  21. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Wonderful! :D

  22. romybompart
    Member
    Posted 1 year ago #

    Hello Guys,
    I am very new with wordpress, but I think I am doing well.. I have a little question, How can I make it work ?, because I did the modification about the definition of yarpp_support at the moment to register ( I got every single post type on the settings), but I think I don't achieve it because I didn't define taxonomies.
    I am trying to do a project of real state company, so I would like to related some post that are similar, houses with houses, buildings with building , but with similar characteristics.
    This is my current configuration on the bottom of my page
    <?php yarpp_related(array('post_type' => array($post_type)));?>

  23. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    @romybompart it sounds like you've done well. :) I don't think you need to specify the array(...) there... I think you can just call yarpp_related();.

    If you're not getting results, I suggest you lower the "match threshold". In YARPP settings, go to the "screen options" tab, turn on the "Relatedness" options, and you will see it. Try lowering the number to 1 or 2 and save. Hopefully you will get results then.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic