tags:

views:

27

answers:

1

I am trying to implement WordPress into quite a large site with a complex page structure and struggling to get normal pages to work (not created through the admin)

When I link to them, nothing happens, well because...

The desired url - www.website.com/dir1/dir2/dir3/page.php

The actual url- www.website.com/wp-content/themes/themename/dir1/dir2/dir3/page.php

The problem with linking to the latter is that it breaks the WordPress functions

I don't want to have to give every page a template, then add it through the admin, it is too much work. I only need 2 pages to contain dynamic content.

I need the files to be inside the theme folder or the wordpress functions will not work.

I also need to keep the folder structure (obviously), but creating new pages using template folders will lose this structure.

Am I being silly? I am really confused.

+1  A: 

In WordPress, there are two basic kinds of content: static content and dynamic content. Dynamic content refers to posts in your feed; static refers to the pages. Both are handled in the admin section. Because WordPress is a publishing platform, its main concern is the content. Because of this, static and dynamic do not refer to your ability to update them from the admin section, but rather the frequency with which they will be updated. I have many websites that have static pages that have not been updated since the day I created them. Blog feeds, however, will change frequently. The former are static, while the latter are dynamic.

If you want the first url structure, the way to go about it would be to do one of two things:

  • create the pages through the back end using hierarchical structures to achieve the url structure (i.e. dir1, dir2, and dir3 would be pages, not directories. They would also be hierarchical, meaning page.php is a child of dir3, which is a child of dir2, etc.), or
  • create those directories physically in your web root folder. As long as they don't conflict with your WordPress folder structure (wp-content, wp-admin, and wp-includes), they will be served instead of a WordPress page.

If you're going to be creating a new php page for each and every static page on your site anyway, I would really suggest just using WordPress for this. I can't imagine you would be using a brand new (and unique) template for every page, so it would save time to use WordPress as it's meant to be used: as a publishing platform.

John P Bloch
So would this work if say, I have a dynamic page and a static page in my sitewww.website.com/dir1/dir2/dir3/page1.php (static)www.website.com/dir1/dir2/dir3/page2.php (dynamic)I need to put page 1 in my root folder, and have my page2 layered through pages in wordpress. How does that work? Two pages, in the same http path, in totally different directories?
danixd
I also have the problem of Wordpress not detecting my page templates when they are nested in so many folders - ok this isn't a problem as I don't need to keep the file in the folder structure if thats the case.
danixd
I'm not sure I understand entirely. If you're going to use WordPress' template system, you don't need the template pages in subdirectories of the theme directory. Think of the theme directory as more of a reference guide for WP to find the correct design for the requested page. You should look at http://codex.wordpress.org/Templates if you haven't already.
John P Bloch
I have dealt with WP templates but this one is on a bigger scale, lots of includes etc I have to deal with. Before I just made categories and page templates etc. I can actually get it working after your tip with layering the pages using parents and children. Thanks for the help.
danixd
My pleasure! :D
John P Bloch