WordPress.org

Ready to get started?Download WordPress

Forums

changes in Index.php not affecting site! (6 posts)

  1. goldenrobot
    Member
    Posted 7 years ago #

    Running the latest WordPress 2.o.4.
    on my Localhost
    using the Sandbox theme
    and Safari on OSX 10.4.8.

    I'm trying to modify my index.php file in my
    Sandbox themes folder to add an additional menu.
    I've added this -
    <?php get_menu(); ?> (Just above the get_sidebar)
    and I've made the menu.php file and placed it in
    my themes folder.
    Saved, Browser refreshed - No changes.
    Hmm So to trouble shoot I cut all the code from
    the Index.php file saved and refreshed browser-
    No change - How can I still be seeing my site
    (even after closing my browser and specifically
    typing in http://localhost/index.php)
    It looks just like it always does with the
    Header, Content, Footer , Styling etc...
    Am I missing something obvious here?
    Thanks,
    Jacob

  2. Evita
    Member
    Posted 7 years ago #

    Maybe I´m totally wrong, but I believe you have to include your own menu <?php include ('xxx.php'); ?>.
    get_xxx is a wordpress template tag and will not work for your own files.

  3. moshu
    Member
    Posted 7 years ago #

    Yes, you are.
    This <?php get_menu(); ?> will never work - unless you write the proper function for it in the WP engine :)

    All those "calls" work in WP because in the core files ther is a function to make it work.
    If you just want to call (include) a file that is in your theme folder, use this:
    <?php include (TEMPLATEPATH . '/yourfile.php'); ?>
    Change only the file name (yourfile) - leave the rest as it is!

  4. goldenrobot
    Member
    Posted 7 years ago #

    Thanks for your help.
    But something's still not right.
    I've included
    <?php include (TEMPLATEPATH . '/menu.php'); ?>
    in my index.php.
    My menu.php consists of this to Test -

    <Div id="menu">
    Hello Hello Test
    </div>

    Nothing shows up in my site though to indicate
    that it's using the menu.php file?

    Any other thoughts?
    Thanks,
    Jacob

  5. goldenrobot
    Member
    Posted 7 years ago #

    More tests and I can literally remove everything
    from the index.php file in my theme and the site
    still functions normally.?

    Even afteropening in a different browser!

    Dosen't WordPress need an index.php file to put
    the page together?

    Something tells me this is affecting my ability
    to modify my site.?

    Any wise words?

  6. moshu
    Member
    Posted 7 years ago #

    1. Are you sure you are not seeing a "cached" version?
    2. Are you sure the theme you edit is in the right place? I mean in my local install (XAMPP) the installation has to be in the apachefriends/htdocs/wp-content/themes/whatevertheme/ directory.

Topic Closed

This topic has been closed to new replies.

About this Topic