WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] include from wordpress parent (5 posts)

  1. startribe
    Member
    Posted 7 years ago #

    Hey Community,

    I have a question about includes. If I had WordPress in a directory as such:

    /root/wordpress/wp-content/templates/my_template/index.php

    would it be possible to use an include that picks up from the root. for example:

    <?php include('../../../../products/item_1.php'); ?>

    Any ideas on how I might be able to do something like this? I'm actually trying to use bbPress and WordPress to pull from the same directory for advertising products, and I think I need some brain storming here.

    Any suggestions would be greatly appreciated.

    All the Best,
    Orion

  2. startribe
    Member
    Posted 7 years ago #

    Sorry, I've included this in the wrong forum on accident, I hope it gets bounced.

  3. startribe
    Member
    Posted 7 years ago #

    Hey Community,

    I have found a solution, and we are using a folder titled global includes in our root folder. This folder inculdes all includes that are used for the headers, sidebars, banners, and etc.

    One note for those who try this, you must include the full url in the include.

    All the Best,
    Orion

  4. marie-aude
    Member
    Posted 6 years ago #

    Can you detail the solution ? I'm trying to do that with the full url and it does not work

  5. marie-aude
    Member
    Posted 6 years ago #

    OK, I found somewhere else. To make it clearer for other people like me : "full url" means full server path

Topic Closed

This topic has been closed to new replies.

About this Topic