WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] [Plugin: Issue with defining YARPP_DIR (8 posts)

  1. bigorangemachine
    Member
    Posted 3 years ago #

    Hello,
    I have a services.php in the root of my site.
    We put wordpress into a blog/ directory.

    The way you define YARPP_DIR (define('YARPP_DIR',dirname(__FILE__));) causes my root services.php to be included when I try to include the wordpress functionality into the existing site.

    <?php
    define('WP_USE_THEMES', false);
    require('blog/wp-blog-header.php');?>

    I suggest using a different method for getting the YARPP_DIR

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

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    I'm not sure what exactly the issue is. What file is getting included where? I actually have a very similar setup on a site I run, and YARPP works fine there.

  3. bigorangemachine
    Member
    Posted 3 years ago #

    Ya sorry that was unclear.

    Okay what I did is have a wordpress integration as instructed here.

    Our directory structure is that the website is in the root(www.site.com/) and wordpress into a folder named 'blog' (www.site.com/blog/). With your plugin installed and active causes the services.php in the root to be included instead of services in the plugin folder.

    So when I put this onto the websites home page (www.site.com) before the doctype... first 2 lines:

    <?php
    define('WP_USE_THEMES', false);
    require('blog/wp-blog-header.php');?>

    It causes our services.php (www.site.com/services.php) to be included instead of services in the plugin folder.

    What we're doing is put the wordpress posts from a specific category (news category) into the website's home page (www.site.com) and then allowing them to link to the wordpress addition to the site (www.site.com/blog).

    So what happens on the homepage is that before the doctype/head tag is that it includes services.php (www.site.com/services.php) ontop of the site.

    What I think is happening is that the define('YARPP_DIR',dirname(__FILE__)); is using the root when you integrate outside of the wordpress environment.

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Hmm, I see... __FILE__ should always point to the current file being executed, which should be that yarpp file, at the point where YARPP_DIR is defined.

    Could you try this? Right after the define('YARPP_DIR',dirname(__FILE__)); line, please add echo YARPP_DIR . ',' . __FILE__; . That'll print out some debug code. Could you paste it in here?

  5. bigorangemachine
    Member
    Posted 3 years ago #

    Mitcho,
    Ya looks like I am wrong. :)
    services.php is incorrectly called in a different plugin incorrectly.

  6. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Did you get this resolved then?

  7. bigorangemachine
    Member
    Posted 3 years ago #

    Yes go ahead and close this if you can.

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Okay, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic