Hello!
Structurally, my website is an index page with a php include (placed in a css div) that calls different content depending on the menu links you click. That content is created through Wordpress.
The php looks like this:
<div id="content"><?php
if (!isset($_GET['page'])) $page= 'home'; else $page= $_GET['page'];
switch($page)
{
case 'home': include ('http://www.website.com/home');break;
}
?></div>
Here's what I'm trying to do. Because Wordpress generates the content into web pages, every time I create a new page, I have to go back into the index page code to add a new line of:
case 'name_of_new_page': include ('http://www.website.com/page');
My site is becoming a bit extensive so I now have a list of 20 or so "cases" listed in there, and I have to keep going back in the code to add them manually.
I figured there must be a way to simply code this with a variable, which would tell the php that
case 'variable': include ('http://www.website.com/variable');break;
. It would be easy for me to make it so the case "variable" is the same word as the "variable" in the link.
I hope my question is clear :eek:. A million thanks to whoever can help me figure this one out!