• Help … I’m a beginner and modifying themes and was creating an “about” page based on directions at https://www.chrisjdavis.org/university/wp-cms/

    I didn’t know which directory’s index.php to modify and so was experimenting and THOUGHT I kept the “theme” index.php” separate from the wp-admin “index.php” and the index.php in the root directory but someone I have now written over both the wp-admin index.php and WP’s root index.php.

    HELP! Does anyone know how to handle this? Can I download a copy of WP (my server has fantastico so I used 1-button installation and don’t have the original files) and search through to find the original index files or will that not work because of changes needed during the install process?? I’m in a panic!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Calm down. No permanent damage has been done.

    Simply download WordPress from the download link above. Extract the files, and then upload the appropriate index.php file(s) to the proper place(s).

    Thread Starter lindalu2

    (@lindalu2)

    Whew .. okay … deep breath. Thanks! Worked like a charm. I still don’t know why I can’t get the “about” page to work per the instructions at
    https://www.chrisjdavis.org/university/wp-cms/

    The author say to “add the following code” to index.php just before <!DOCTYPE … and then the top of the page should look as follows:

    <?php
    $cat=”-9″;
    require(‘./wp-blog-header.php’);
    ?>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”
    https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; xml:lang=”eng”>
    <head profile=”https://gmpg.org/xfn/1″&gt;

    This theoretically tells WP to ignore category 3 (which in this case I designated as the “about” category).

    When I did this, I used the index.php from my theme rather than the wp-admin directory’s index.php or the root index.php.

    Author then says to open index.php again, retitle it about.php and change the first few lines as follws:
    <?php
    $blog = 1;
    $cat=”3″;
    require(‘./wp-blog-header.php’);
    ?>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”
    https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&gt;
    <html xmlns=”https://www.w3.org/1999/xhtml&#8221; xml:lang=”eng”>
    <head profile=”https://gmpg.org/xfn/1″&gt;

    Sooooo .. did that. Uploaded about.php in the root directory with the root index.php (I installed WP in the root directory) and can link to it just fine but it doesn’t show any posts. Then the posts I put in category 3 (about) which are supposed to be hidden from the main page and only appear on the “about” page ….. aren’t hidden.

    Any thoughts? Thanks!
    Save as about.php. Now can log into wp-admin area and create as many entries as you would like for the colophon/about page, and they will magically appear on colophon.php but never show up on index.php. Do this for each of your other pages changing the $cat=”(n)”; to match whichever category you are wanting to echo out on that page.

    If you’re using WordPress 1.5 or above, this whole process has been simplified with the introduction of WordPress Pages.

    See also Chris’ new tutorial about this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wrote over Index.php accidentally’ is closed to new replies.