WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] related_posts on pages (31 posts)

  1. elotse
    Member
    Posted 3 years ago #

    I try to implement YARPP functions to pages. For Testing I used the same tags fort the test page and for posts. The match threshold is set to 1.
    1) If I’m using related_posts() there is no related post!
    2) If I’m using related_pages() or related_entries() only pages are displayed
    Some idée ???

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Try related_entries and make sure the "cross-relate posts and pages" option is turned on in the YARPP options.

  3. elotse
    Member
    Posted 3 years ago #

    The option cross-related posts and pages is turned on!
    For testing there is a test page: http://www.test.kk4you.de/yarpp-testseite
    The cross related test post is: http://www.test.kk4you.de/yarpp-test-post-519.htm
    On the test page all three versions are implemented (posts, pages and entries). I believe there is something wrong with the post function because there is no indication of related posts (zur Zeit sind keine Beiträge verfügbar)

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Ah, thank you for bringing this to my attention. I just made a little change which might fix this... could you try this new version?

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

    You can try first my upgrading to this version, then if it still isn't fixed, if you could try clearing your cache, that'd be great.

  5. elotse
    Member
    Posted 3 years ago #

    There is a change, but I believe it’s still not working correct!
    1) The function related_posts implemented on the page test side shows me the same result as the others! (related_pages or related_entries)
    2) For testing I reduced the relevance just to the Tags only to get the input of the test post with the tag YARPP.
    3) There is still no input from the posts!!!!!

  6. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Hmm, I see. So at least with "cross-relate" it's giving you the same results everywhere now, which is a fix. As for the relatedness, have you tried adding more tags which they have in common? Keep in mind that pages by default don't have tags, so that may be a limiting factor. Does that test page have the YARPP tag on it?

  7. elotse
    Member
    Posted 3 years ago #

    I test now with 4 Tags (apfel, banane, birne, yarpp). These tags are only used by this test page and post!
    For the tagging of pages I’m using the plugin tagpages
    I checked also the code of the page:
    <meta name="description" content="Test der YARPP Funktion" />
    <meta name="keywords" content="apfel,banane,birne,yarpp" />
    <link rel="canonical" href="http://www.test.kk4you.de/yarpp-testseite" />

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    @elotse, what plugin is this? Can you add a link for that tagpages plugin?

    You might want to try adding a lot of the same content to both too to see if just the content body will pick up the relatedness.

  9. elotse
    Member
    Posted 3 years ago #

    Hello Mitcho,
    The Link to the used Plugin: tagpagesFor testing I have implemented the same content on the page and post
    The result is no different. The post will not be found!!!

  10. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    I believe the tagpages plugin is doing a lot more than it needs to do to get that functionality. I added the same functionality on a couple of my sites with the following code in functions.php of my theme:

    add_action('init', 'ecs_theme_init');
    function ecs_theme_init() {
    register_taxonomy_for_object_type('post_tag', 'page');
    }

    You may want to try that too.

    Otherwise... try adding some more redundant text! Are you getting results elswhere with posts showing up?

  11. elotse
    Member
    Posted 3 years ago #

    The problem still exists!
    To get it solved I have done the following actions.
    • All other plugins are deactivated (there should no influence)
    • YARPP completely new installed with your new version
    • Created a post and page with the same content and the same tags
    post: http://www.test.kk4you.de/yarpp-testseite
    page: http://www.test.kk4you.de/yarpp-test-post-519.htm• Implemented on the single.php and the page.php the same test code with all three functions

    <?php
    echo "<br><br><h5>test of related_posts</h5>";
    related_posts();
    echo "<br><br><h5>test of related_pages </h5>";
    related_pages();
    echo "<br><br><h5>test of related_entries =posts and pages</h5>";
    related_entries();
    ?>

    Results:
    1. If the option „show post and page together“, is switched on, in general all three related function gives me the same information
    The different is between page and post
    The post shows the related page and post
    The page shows related pages only
    2. If the option is switched off
    The page has no input by the function related_posts
    The post has no input by the function related_pages

    As the last test i implemented in the function.php your proposal code but it was no influence.

  12. Virtuallaw
    Member
    Posted 3 years ago #

    Great plugin! Thank you for your work!

    I've a similar problem:
    I've integrated related_entries() and related_posts() in the page template.

    I made an extralong post which is an exact copy of an extralong page. They have the same categories and tags.
    http://www.virtuallaw.at/recht/
    http://www.virtuallaw.at/allgemein-markenanmeldung-80/

    I've choosen „show post and page together“ in the YARPP config panel.

    Result:
    + The post frontend shows the page as a related entry.
    - The post backend "related posts box" doesn't show the page as a related entry (continues to show only related posts)
    - The page frontend only shows "no results" (which I configured in the YARPP config panel to make sure that the related_entries() code does anything at all).
    - The page backend doesn't show the related post box at all.

    So it works only in the posts front end.

    I hope this is understandable.

    Thank you for any help!

    Greetings Peter

    (I updated to the newest version on wordpress.org before posting to make sure it's not an old version prob)

    Using
    add_action('init', 'ecs_theme_init');
    function ecs_theme_init() {
    register_taxonomy_for_object_type('post_tag', 'page');
    register_taxonomy_for_object_type('categories', 'page');
    }

  13. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Okay, I think I finally figured this issue out. Please try out this new beta:

    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.2.2b1.zip

  14. Virtuallaw
    Member
    Posted 3 years ago #

    Thank you for your help!

    I tried it and it got better but it is not fixed:

    Results:
    + The post frontend shows the page as a related entry.
    + The post backend "related posts box" shows the page as a related entry (continues to show only related posts)

    - The page frontend only shows "no results" (which I configured in the YARPP config panel to make sure that the related_entries() code does anything at all).
    - The page backend doesn't show the related post box at all.

    So YARPP works within posts but not within pages.

    Greetings, Peter

  15. Virtuallaw
    Member
    Posted 3 years ago #

    Update:

    I reconfigured YARPP to shows results with relevance 1 instead of 5.

    Now the pages frontend shows results, but weird ones.

    The page backend still doesnt show the yarpp box (is there anything special to do to make this work? maybe I havent done something important?)

    The page shows only 2 posts with result 1 but not the almost identical post.
    http://www.virtuallaw.at/recht/

    The almost identical post shows the page (relevance 78) and some other less relevant posts and pages.
    http://www.virtuallaw.at/allgemein-markenanmeldung-80/

    I also tried relevance 1000 to make sure that the page doesnt work the other way round and only shows posts <= relevancy but then posts and pages show no results at all (which is most likely correct).

    I kept the yarpp settings at 1 so that you can see the results yourself.

    Greetings Peter

  16. Virtuallaw
    Member
    Posted 3 years ago #

    OK, this solves the pages backend problem:

    function yarpp_add_metabox() {
    	if (function_exists('add_meta_box')) {
        add_meta_box( 'yarpp_relatedposts', __( 'Related Posts' , 'yarpp'), 'yarpp_metabox', 'post', 'normal' );
        add_meta_box( 'yarpp_relatedposts', __( 'Related Posts' , 'yarpp'), 'yarpp_metabox', 'page', 'normal' );
    	}
    }

    Maybe it can be solved better or even as an option in the YARPP options page, but my php skills arent good enough for this :(

    Greetings, Peter

  17. Virtuallaw
    Member
    Posted 3 years ago #

    More Info:

    It's weird :)

    1) The page has 2 relevant posts. I can make these entries more or less relevant by adding or removing categories and tags. adding content or changing the headline doesn't have any influence on the weight of these posts (in the "service" page - in posts everything has an influence as expected).
    2) Those entries are the 2 oldest posts.
    3) I can't make any newer post relevant no matter how hard I try.

  18. Virtuallaw
    Member
    Posted 3 years ago #

    It's the same for the "Kontakt" Page. It seems to be a general page problem

  19. Virtuallaw
    Member
    Posted 3 years ago #

    Ooooooook!

    Solved the mystery :)

    1) Yarpp only shows posts & pages that are older than the page if it's used on pages - no matter if the "only show older posts" checkbox is set or not (which I hadn't set).

    2) Yarpp on pages seems to calculate extremly different than on posts. It seems to calculate only headline, categories and tags, but not content if used on pages.

    Greetings Peter

  20. Virtuallaw
    Member
    Posted 3 years ago #

    One more question:

    What is the purpose of the "show post and pages together" (I use the german version) option?

    It seems that this option was created to make posts show all entries instead of posts only.

    Wouldn't it be a way cleaner solution simply auto-inlude related_entries instead of related_posts if this option is used instead of giving related_entries, related_posts and related_pages the same results?

    Greetings Peter

  21. elotse
    Member
    Posted 3 years ago #

    @mitcho
    I tested the 3.2.2b1 but on the pages are no different!
    Regards
    elotse

  22. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    @Virtuallaw Thanks for your great feedback! I'm a little confused, though. I just reviewed the code and there's no way that the results are being limited using the "only show older posts" if that option is not on. Whether it's calculating posts or pages here doesn't matter.

    The "cross_relate" option is meant to make related_entries, related_posts, and related_pages give the same results. Now that this is fixed in 3.2.2b1, I will go ahead and release this as 3.2.2.

    As for why the results aren't showing up as well on pages, I'm not sure that I have an answer for that. I hope to keep looking into this issue in the future. Thanks again for your feedback!

  23. Virtuallaw
    Member
    Posted 3 years ago #

    You are welcome :) Thanks for the great plugin!

    If "only show older posts" is activated, posts show only posts that are older than the current post. If its deactivated posts shows all posts. OK.

    But Pages seem to show only posts that are older than the page, no matter if "only show older posts" is set or not.
    If a page exists and one posts a 100% copy of the page as a post, it won't show up as a related post on the page. If a change the publish date of the post so that the post publish date is before the page publish date the post shows up.

    Greetings Peter

  24. elotse
    Member
    Posted 3 years ago #

    @mitcho
    With Version 3.2.2 and deactivated option "only show older posts"
    all three versions of related_xyz are working correct on my pages.
    Thank you for your help and the excellent plugin
    Regards
    elotse (http://www.kk4you.de)

  25. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    @Virtuallaw hmm. Well, as I said, I looked through the code and the use of the "only show older posts" option is completely identical between posts and pages. I'm not sure why this effect is occurring. :(

    @elotse glad things are looking better for you! :) Thanks for the feedback.

  26. Virtuallaw
    Member
    Posted 3 years ago #

    Somehow the "show only older posts" problem vanished... no idea why...

    So the only problem that still exists is that it seems that the content of posts / pages isn't calculated if YARPP is used on pages.

  27. Virtuallaw
    Member
    Posted 3 years ago #

    I deactivated all other plugins - no results. The content calculation problem stays.

  28. FaithMechanic
    Member
    Posted 2 years ago #

    I too want to add this function to Pages. My posts are working wonderfully but the pages do not.

    What code do I need to insert and where does it go? Sorry, I am not a good coder. I am using the Atahualpa theme - http://wordpress.bytesforall.com/?p=98

    My site is http://hopefaithprayer.com/

  29. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    @FaithMechanic the main issue here has been resolved by the most recent version of YARPP. There may be a remaining issue, but I have not been able to reproduce it and am not currently pursuing it.

  30. taufanxxx
    Member
    Posted 2 years ago #

    @Mitcho:
    What is different <?php related_posts() ?> AND <?php related_entries() ?> ?

    It's look the same.
    For your information, i paste that code on my single.php

    By the way, i use plugin Custome Post Type UI plugin to make the Custome Post. Can i show the Related on page, post, Custome Post Typ on YARPP ? I'm newbies, little knowledge about php or something about that.
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic