WordPress.org

Support

Support » How-To and Troubleshooting » How to keep index.php running while updating it

How to keep index.php running while updating it

  • I’ve had my blog up for maybe two weeks and already I’m getting the itch to change the template.

    Ordinarily, I know it’s just a matter of dropping in the new index.php, wp-layout.css and graphics you’d find in a new template, but since I’ve made modifications to the code in my index.php I was wondering if anyone could suggest a painless way of keeping the “old” one available to the public while I work on the new template.

    Could I just make a copy of my blog directory with a few minor adjustments so both the old and the new read from the same database? Or are we talking a redirect of some sort of which I’d need help doing as I’ve never done that before.

    Thanks for any input!

Viewing 15 replies - 1 through 15 (of 23 total)
  • You could create another site that is your testing ground for a design, and then once you have it to where you want it, simply copy over the files to your existing site.

    This sort of thing is going to be SO much easier in 1.5 with Themes…

    In the past I simple created an Index2.php and wp-layout2.css. Make sure the index file is looking for the correct style sheet.

    When you are finished just rename you live/working version with a prefix(old_) and then rename index2.php to index.php (Same for css) and eveything should be fine. Any problems and at least you have the originals ready.

    hth
    Phillip

    sorry, double post

    Sorry for the late reply (it has been a long day). Thanks for the advice!

    NuclearMoose:
    Does what you’re suggesting require a separate installation and/or database? I like the concept, but concerned about the possible (if any) circumstances I’d have to employ to the test site. Maybe I’m being overly concerned here, in which case just say “snap out of it”…and provide a little more instruction. 🙂

    planetphillip:
    I thought it might have involved more files, but I’ll give that a whirl, too.

    Davincim,

    I have three test sites on the go right now, and it’s really easy to do. The basic idea is that you can use the same database, but create a unique set of tables for your test site.

    Yes, you will have to have another folder to install WordPress into, but all you need to do is copy over the wp-config.php file from your existing site, and make one edit, and then run the install.php script, and you’re good to go.

    – Create a new folder for your test site, and upload all of the WordPress files into it as you did for your first site.
    – Copy the wp-config.php file from your first site and paste it into your new folder.
    – Edit wp-config.php and change the line that reads $table_prefix = 'wp_';' to give your new test site it”s own unique table structure. For example, change the wp_ to test_ and then save your changes. You can keep the same DB Name, DB User, and DB Password as well as the DB Host. Don’t change any of that.
    – Now, navigate to your new folder via your browser, just as you did in the first site, and go to wp-admin/install.php and run it.
    – A new blog will be created as before, and you are ready to go mad with it.

    If you’re not sure about the instructions, just post back and I’ll clarify things for you. You are doing everything exactly the same as when you installed the first blog, except for putting the files into a new folder and changing the default table prefix.

    Thanks NuclearMoose! Sounds straight forward. I’ll move forward with it and get back to you.

    Okay, I followed your instructions and the installation went off without a hitch. However, it won’t let me log in to the administration page. I used the password that was generated at the end of the installation, but it says “incorrect password”.

    I thought maybe registering would be what’s missing, but when I do that it says there’s already a login like that.

    I’m sure the solution is easy, just out of my range of vision.

    [edit]
    Okay, thinking I needed to log out of my of my first blog’s admin, I did that. Didn’t do the trick, and now I can’t log back in under the old id and password. And retrieval attempts say that there’s no user in your database. I’m usually pretty good at writing down such information as it’s given to me, but it’s possible I missed it the first time I installed it a couple of weeks ago.

    Suggestions?

    Okay, it’s late. I found the first login information. Now all I need is figure out how to use the new “test” one.

    NuclearMoose,

    Any advice on why I’m having trouble with logging in? Thanks for your help!

    Are you still having login troubles? Are you getting any specific error messages?

    Yes, I’m still getting “Error: Incorrect password.” But I’m using the same password that was generated during installation.

    Try this to reset your password:
    http://www.tamba2.org.uk/wordpress/phpmyadmin/

    Okay, I read the instructions over and I understand them. However, before I go resetting things, I want to make sure I get your feedback on what I saw.

    If I understand correctly, shouldn’t there be two users for
    “admin”, one for my live blog, the other for my test? Both installations gave me an id and password, so shouldn’t I have been expecting two users in my database? I only saw one. I didn’t reset it because I figured that was going to reset my first password.

    If this just the way it’s supposed to be, then I’m okay with that. I just found it a little odd that there wasn’t more than one user listed.

    Please advise and thanks for your continued patience and help. 🙂

    If you set up two blogs in one database, then you have two *_users tables, and only one admin account in each.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘How to keep index.php running while updating it’ is closed to new replies.
Skip to toolbar