[Plugin: Yet Another Related Posts Plugin] YARPP Not Compatible with Child Themes? (22 posts)

  1. Derek Perkins
    Posted 7 years ago #

    I'm using a child theme, but it doesn't appear that YARPP supports it. It keeps looking to the parent theme for WordPress templates as well as the YARPP templates. Is support for this going to be added?

    Warning: include(/home1/derekper/public_html/seatability/wp-content/themes/hybrid/) [function.include]: failed to open stream: No such device in /home1/derekper/public_html/seatability/wp-content/plugins/yet-another-related-posts-plugin/magic.php on line 300

  2. rickybuchanan
    Posted 7 years ago #

    I very much hope YARPP is updated to deal with parent/child themes - I'm having the same problem.

    I have noticed it seems to work if you
    a) rebuild the cache manually
    b) turn off the automatic inclusions in pages/RSS feeds
    b) edit your child theme's single.php so you call the related_post() function manually
    Then it'll work with a child theme, but it still gives the above error message on your admin page.

  3. @Ploobers - please see this thread (http://wordpress.org/support/topic/265541) for the include error.

  4. Derek Perkins
    Posted 7 years ago #

    @mitchoyoshitaka - that isn't the problem I am having. YARPP is looking under wp-content/themes/parenttheme/ for everything, when it should be looking at wp-content/themes/childtheme/. That breaks a number of different things, both in the admin and in the frontend of the site.

  5. I concur, this is an issue for me as well.

  6. Wait... I see that this is a different issue now... I've never heard of parent/child themes. Is this a built-in WP behavior? Or is it based on a plugin?

    Also, would putting the yarpp-template files in the parent theme not be acceptable?

  7. From http://wangenweb.com/2008/07/creating-wordpress-child-themes/

    A Child Theme in WordPress is simply a “style only” Theme, and is easily made by adding Template: themefolder to your style’s header.

    The idea is that you download a theme, NEVER CHANGE that theme, and make your mods in a child, so that you can upload/upgrade the parent all you want, and not have to go 'Oh, wait, I changed the style.css to have this as that...' and replace your images.

    For some reason the files for yarpp are only being picked up in the parent theme, which can work, but is a bit against the idea of the child/parent relationship. You should be putting all your customizations in the child.

    See also: http://themeshaper.com/forums/topic/how-to-change-the-look-of-thematic-with-a-wordpress-child-theme

  8. Ahah... reading about STYLESHEETPATH vs TEMPLATEPATH right now....

  9. I created an updated version of magic.php and options.php with a possible fix. If one of you would like to try it out and let me know if it works, I'd very much appreciate it! Thanks! ^^

  10. Works!

  11. Ha! Great! If someone else can corroborate, I'll push this change out as 3.0.2.

  12. Alright y'all, I got antsy and pushed this as 3.0.2. After wordpress.org updates its servers, you'll be able to download it... should fix the child themes issue. :)

  13. Derek Perkins
    Posted 7 years ago #

    I updated to 3.0.2, but I'm still getting this error when it automatically inserts into my post. You can see it here, but I may deactivate the plugin so it doesn't show up while I'm trying to fix things.


    Warning: include(/home1/derekper/public_html/seatability/wp-content/themes/seatability/) [function.include]: failed to open stream: No such device in /home1/derekper/public_html/seatability/wp-content/plugins/yet-another-related-posts-plugin/magic.php on line 300
    Warning: include() [function.include]: Failed opening '/home1/derekper/public_html/seatability/wp-content/themes/seatability/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/derekper/public_html/seatability/wp-content/plugins/yet-another-related-posts-plugin/magic.php on line 300
  14. Derek Perkins
    Posted 7 years ago #

    Also, I put the yarpp-templates folder into my child theme folder, but in the admin screen, it still tells me that it can't find the themes and that they are disabled.

  15. @Ploobers - I accidentally did not include my patch for version 3.0.1 with 3.0.2... see here: include topic.

  16. Justin Tadlock
    WordPress God
    Posted 7 years ago #

    If you're searching for a specific template file, you should use locate_template() to search in both the parent and child theme.

    locate_template( array( 'file-name.php' ), true );

    This will be the same as using include or require, but it'll do the searching for you.

  17. @greenshady thanks. Now that it's using STYLESHEETPATH I haven't received any complains, so I think most people are happy with it now. :)

  18. gfranks
    Posted 7 years ago #

    Hi :)

    I've installed the plug-in, I keep getting a message saying that the templates are not in the content folder, but I have moved them as per the installation instructions. I've deleted and reinstalled but I still get the same problem. I am using version : 3.0.5

    Also I am using a Word Press theme and while I get the related posts on each post, I have some pages it's not appearing (category pages). I've looked at my templates to see if I can see your code so I can copy it to those pages (so the posts will be displayed), but I can't seem to see the code. Can you tell me on what pages it would be installed?

    Here is an example of a page where it won't show up.

    And here is an example of where it's working fine.


  19. mkirkwag
    Posted 7 years ago #

    Hi, mitchoyoshitaka. I'm having the same problem asa Graeme.
    At the top of my settings page it says "No YARPP template files were found in your theme (/home/tribeofa/public_html/wp-content/themes/our-rights) so the templating feature has been turned off" but I installed as directed and when I check the path, the folder labelled "our rights" on the path public_html>wp-content>themes>our-rights. What am I missing.

    My problem differs from Graeme's in that nothing shows up on any of my pages. I've changed the settings, saved them. and rebuilt the cache several times. I've lowered the threshold to one, and only disallowed one category. I tried pasting related_posts() and related_pages() into the pages template, but I'm not sure I put it in the right place. It didn't work, so I removed it.

    Any idea what the problem might be? It seems like a great plug-in and I'd love to use it,

  20. mkirkwag
    Posted 7 years ago #

    I should have said - my site is http://tribeofadmins.com

  21. @gfranks - the "automatic display" option will only show up on your single post display pages, not category pages. If you want to, you can add the code <?php related_posts() ?> to your category template. Just make sure it's in the loop.

    @gfranks, @mkirgwag, As for the templates, perhaps you copied the yarpp-templates folder instead of the yarpp-template-....php files? You want those files to be right under your theme. That said, you can continue to use the plugin (modulo the templating feature) without installing these template files.

    @mkirgwag, if you don't get any display at all, this may be a different issue. Is the "automatic display" option on? Do you see nothing at all or the "no related posts" text?

  22. mkirkwag
    Posted 7 years ago #

    Sorry I took so long to answer! I missed this. Thanks so much for checking back. I now see "no related posts" on one - the newest - post, and nowhere else, BUT I don't think the problem is with your plug-in. I've since discovered that there is something wrong with the way I've set up permalinks. I've set them to /%postname% which displays the name of the site followed by the name of the post. That seemed pretty good, but unfortunately, it resulted in some kind of problem whereby individual posts won't show. If you click on the name of a post, it just cycles right back to the top of the main blog page (which is it's 404 file not found behavior- I'm fixing that, too). I'm trying to find a fix that will let me display the link name the same way so that I won't have to redo all of my links. Which is a very long way of saying that I think your plugin can't work until I fix the link structure.

Topic Closed

This topic has been closed to new replies.

About this Topic