WordPress.org

Ready to get started?Download WordPress

Forums

place in the index.php the line not appropriate to WP 1.5? (5 posts)

  1. chueewowee
    Member
    Posted 9 years ago #

    This advice to place in the index.php the line:
    <? include ($DOCUMENT_ROOT . "/path/to/trackinfo.txt"); ?>

    in order to include ituens data written to the file by kungtunes is possiby not appropriate to WP 1.5, with which I am just beginning. Can you let me know and, if it isn't , where it should go?

  2. Kafkaesqui

    Posted 9 years ago #

    WordPress does not set $DOCUMENT_ROOT as a variable, so your options are to do this yourself:

    <?php
    $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
    include($DOCUMENT_ROOT . '/path/to/trackinfo.txt');
    ?>

    Or use this in your WordPress template:

    <?php include(ABSPATH . '/path/to/trackinfo.txt'); ?>

  3. chueewowee
    Member
    Posted 9 years ago #

    Thanks. Ok, that means the index.php file in the selected themes folder, I think? Would that bring it up, if so where in the blog page?

    Also does '/path/to/trackinfo.txt' mean I write '/public_html/wordpress/trackinfo.txt' for example?

    I'm on WO 1.5 is a template now a 'theme', or is it the wp.php file? I don't see a template tab in the admin. (still alittle confused, partly I suspect due to this time of transition to 1.5, and the mass off stuff around from earlier).

  4. Kafkaesqui

    Posted 9 years ago #

    Probably best to use the second option I have above (ABSPATH) because it's WordPress aware. And we know it will point to the main directory for your blog (i.e. where wp-blog-header.php and wp-config.php reside). If that's the /wordpress sub-directory in your main web directory, you should use:

    <?php include(ABSPATH . '/trackinfo.txt'); ?>

    For 1.5, a theme is a collection of php files a.k.a. templates (index.php, comment.php, etc.) and at least one stylesheet (style.css). Some themes include images, as well. So when we say template around here, we really mean one of your php files, whether for a theme or a PHP/WordPress document of your own creation.

    Where your trackinfo.txt should be included depends on what it does and where you want it. If it's just a file with some text/html you want to display in say the sidebar, then you'd want to place it somewhere in sidebar.php, or if your theme doesn't have this in the menu/sidebar section of theme's index.php.

  5. chueewowee
    Member
    Posted 9 years ago #

    Thank you Kafkaesqui I think that all (that) is clear to me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.