WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] .php page within subfolder (11 posts)

  1. ianbarker
    Member
    Posted 7 years ago #

    I'm trying to make Pages whose url will not be an id.php type file that WP makes, but will belong in a subfolder. My blog will be the home page of my missionary support site and want to have other Pages with the same design as my blog.

    I tried making a Page but don't know where the file is to rename it. I tried placing it in a folder and it is broken because it can't "get" the "header".

    Does this make sense? Any suggestions?

  2. whooami
    Member
    Posted 7 years ago #

    thats not how wordpress works -- pages created with wordpress dont go in folder.. they're created dynamically - the content of which is stored in your database, not in a file that can be moved physically.

  3. whooami
    Member
    Posted 7 years ago #

    if you merely want to create a basic page (not using the wordpress Page creation thing), you can do this:

    1. create a page using your favorite editor - for simplicities sake, it needs to be a .php page

    2. upload it to wherever you like on your site.

    3. To use wordpress functions and whatnot in the page you need to call wp-blog-header.php at the top your created page.

    For instance, lets say you created a page named test.php
    and you have uploaded it to a directory named things
    In my example:
    The url to your blog would be: http://www.myblog.com

    The url to your new page would be: http://www.myblog.com/things/test.php

    at the top of test.php you need to have the following:

    <?php
    require('../wp-blog-header.php');
    ?>

    The two dots tell PHP to look for the file wp-blog-header in the directory above where your newly created test.php is.

    Follow?

  4. ianbarker
    Member
    Posted 7 years ago #

    Yeah, that makes sense. I just didn't know how to change where it calls the header from since it will be a different folder.

    Do you know how to change my title since the header pulls the header from the blog/page WP entry?

  5. whooami
    Member
    Posted 7 years ago #

    I dont understand your question, sorry.

  6. ianbarker
    Member
    Posted 7 years ago #

    Okay. So if I publish a Page on WP, the post name will serve as the title of my page (the title within my header). The header is set-up so that the post/page title is the title in the browser window. It changes based upon the title I publish because it calls it up automatically. But if I create my own page and upload it without publishing it through WP, the title won't be called from the post/page. So I will want to change it somehow without editing the header.php file. Hope that makes sense.

  7. whooami
    Member
    Posted 7 years ago #

    well you put that into the page you are creating.. remember what Ive suggested is basically just creating a normal page just like yo would if you didnt have wordpress.

    Thats what <title></title> is for.

  8. moshu
    Member
    Posted 7 years ago #

    I'm trying to make Pages whose url will not be an id.php type file that WP makes, but will belong in a subfolder.

    Just a thought:
    If you are using WP anyway, wouldn't be much-much simpler to set up your "nice permalinks", i.e. instead of
    example.com/?page_id=2 > something like
    example.com/about ?
    And having that, you can create a parent Page, which would function as a "folder", and all its children Pages as "files" in that folder:
    example.com/about
    example.com/about/about-me
    example.com/about/about-the-site... etc.

  9. whooami
    Member
    Posted 7 years ago #

    you can tell I dont use that pages thing eh :P

    I make all my pages with blood sweat and tears :)

  10. ianbarker
    Member
    Posted 7 years ago #

    Yeah, I've been talking to a friend and that's what he did. Or something similar. So I'm going to try that tomorrow. Thanks for all of your help! I think I can figure this out.

  11. ianbarker
    Member
    Posted 7 years ago #

    Cool. I have it working the Permalinks way. I have it url.com/year/month/post-name/ I didn't think that would work for Pages because I thought it would still throw the year and month in there. But it only does the Page so it is http://www.ianandjocelyn.com/resources/ (that's now an actual URL right now but will be.)

    So I'll keep playing with this tomorrow. Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic