Support » Fixing WordPress » custom sections

  • 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

    and my URIs for them could be

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom sections’ is closed to new replies.