WordPress.org

Ready to get started?Download WordPress

Forums

How to keep index.php running while updating it (24 posts)

  1. davincim
    Member
    Posted 9 years ago #

    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!

  2. NuclearMoose
    Member
    Posted 9 years ago #

    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.

  3. Kafkaesqui

    Posted 9 years ago #

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

  4. planetphillip
    Member
    Posted 9 years ago #

    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

  5. planetphillip
    Member
    Posted 9 years ago #

    sorry, double post

  6. davincim
    Member
    Posted 9 years ago #

    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.

  7. NuclearMoose
    Member
    Posted 9 years ago #

    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.

  8. davincim
    Member
    Posted 9 years ago #

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

  9. davincim
    Member
    Posted 9 years ago #

    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?

  10. davincim
    Member
    Posted 9 years ago #

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

  11. davincim
    Member
    Posted 9 years ago #

    NuclearMoose,

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

  12. NuclearMoose
    Member
    Posted 9 years ago #

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

  13. davincim
    Member
    Posted 9 years ago #

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

  14. NuclearMoose
    Member
    Posted 9 years ago #

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

  15. davincim
    Member
    Posted 9 years ago #

    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. :)

  16. Kafkaesqui

    Posted 9 years ago #

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

  17. davincim
    Member
    Posted 9 years ago #

    You're right, Kafkaesqui. I went back to check and remembered about the "test" reference to my other blog. I know what to do now.

  18. Roar
    Member
    Posted 9 years ago #

    My files are split, so I call header and footer via php...

    I think it will make future skinning easier...

    but I just do the same thing as mentioned above...

    index2
    wp-layout2
    header2
    footer2

    :)

  19. davincim
    Member
    Posted 9 years ago #

    Okay, I've successfully installed a test area, but I have to ask: how do I get the new index.php to read the posts I've already put into my database? This would really be helpful as I'd like to view new layouts with something as close to the real thing (my live blog).

  20. davincim
    Member
    Posted 9 years ago #

    bounce

  21. davincim
    Member
    Posted 9 years ago #

    My gut tells me the solution is right in front of me, but I need someone to turn on the lights.

    Pleeeaassseeee? :)

  22. worchyld
    Member
    Posted 9 years ago #

    What I did was to completley ignore the stylesheet or how the index.php file was treating it and instead of reading the help file, I rewrote both the stylesheet and index.php's handling of the stylesheet. maybe you could do that too?

  23. NuclearMoose
    Member
    Posted 9 years ago #

    davincim,

    If you are wondering about having your test site showing all of your production site posts, this won't happen. Why? Because your test site is using a completely different set of tables. You could use phpMyAdmin to copy the contents of your production tables to your test tables if you are comfortable doing that. Otherwise, you could simply do a cut/paste method from one admin panel to the other or simply just use a Lorem Ipsum kind plugin to supply you with some content while you do your tests.

  24. davincim
    Member
    Posted 9 years ago #

    Thanks NuclearMoose and worchyld! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.