multiple Pages in a single Page?
-
I’m working on creating a web site for a friend, and it’s turned out much more complicated than i thought. I wanted to be able to control all of the content through WordPress so that he can manage it. You can see the HTML version I’ve built here.
I’ve been working on the page.php template. So far, I thought that I could make a Page for each area (i.e., the bottom “bio” area is a Page called “Variety Bio” and is child of “Variety”, the “documents” area is a Page called “Variety Docs”), and have it change depending on the main Page that’s called (in this case it would be the “Variety” Page).
Is there a variable that I can use throughout to refer to the main Page (“Variety”, in this case)? I tried doing something like this, where i made a variable called $mainID equal to the_ID() farther up the page:
<?php
if ($mainID = 3) {
get_a_post(17);
}elseif ($mainID = 4) {
get_a_post(20);
} elseif ($mainID = 5) {
get_a_post(22);
} else{
echo "this is broken";
}
the_content();
?>I’m using the plugin Get-A-Post. It just kept giving back the mainID as 3 and displaying post 17 (the Variety Bio), even when I changed to another Page. I’m pretty new to PHP and I’m not sure exactly how to handle variables. Any suggestions or alternatives would be greatly appreciated.
Thanks,
Tracie
- The topic ‘multiple Pages in a single Page?’ is closed to new replies.