WordPress.org

Ready to get started?Download WordPress

Forums

custom sections (3 posts)

  1. kenkam
    Member
    Posted 8 years ago #

    I want to make different sections for my site where each section's layout differs slightly with the other ones. Because of this, the wordpress pages wouldn't cut it for me. I am looking for a way to redirect users to custom php files.

    e.g. my theme folder could look like this
    theme/section1.php
    theme/section2.php
    theme/home.php
    theme/header.php
    theme/index.php
    theme/footer.php
    ...

    and my URIs for them could be
    mydomain.com/section1/
    mydomain.com/section2/

    I was thinking of using a simple php script at index.php like this:


    if( $_SERVER['REQUEST_URI'] == '/section1/' ) {
    include( './section1.php' );
    } elseif { $_SERVER['REQUEST_URI'] == '/section2/' ) {
    include ( './section2.php' );
    } else {
    include ( './home.php' );
    }

    home.php would be the homepage.
    section1.php and section2.php would be my section files.

    Would this be a feasible way around it?

  2. Chris_K
    Member
    Posted 8 years ago #

    You know... you could use multiple page templates for your pages, each page template being slightly different layout than others.

    See this link for more info http://codex.wordpress.org/pages#Page_Templates

    Does that help or did I miss the point completely?

  3. Dgold
    Member
    Posted 8 years ago #

    Page Templates, same thing I thought of. That looks like page templates, to me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.