Integrating other pages in WordPress
-
Hello all. First I’d like to say that the support forums have so far been very helpful, and I’m very happy using WordPress.
My dilemma is this: I use wordpress in the root of my site for the majority of my content. I would like to add additional content to the site (which are in subfolders) that displays in the section where the posts usually show up to keep the site look same-same throughout. The content to be included would be just regular ol’ html. One of the reasons for this is if I need to change the location of one of my sections, I’d like to only have to edit the menu once.
I have tried using iframes, but have a personal dislike for frames.
What I would like to do, just because I think it would be cool is to use index.php?section to link to the section, displaying the contents in the ‘content’ section of the page.
For reference my site is http://www.salens.org and that is where wp is installed. Some of the other content is http://www.salens.org/projects/ which isn’t a full representation of what that section will hold, but it’s a start.
Thanks in advance for any help that can be provided, and I’ll understand if it just cannot be done.
-
You could make the .html pages php, and then you just include the header and footer. Seems the best way. And with mod_rewrite you have a good alternative for index.php?section…
I’m sorry, you were a tad faster. My answer is just a short one, but hey…
I’ve been planning on messing with my site.. and tonight could be the night seeing this. Some q’s though:
wp is in /T2/
I chop out these bits above – I could put them in another directory inside /T2/ ? Not just wp-includes ?
I ask because I like to keep my extra changes away from anywhere that I might accidentally overwrite with an upload.
If I make a page in /about/ I would have to make sure that this linerequire('./wp-blog-header.php');
is correctly routed and with the includes call them with a relative url ?
I don’t need my menu/footer to look the same as the blog page, in fact I want it different, so I don’t want it to interfere at all with my wp.You should use absolute URL,
/something/wp-blog-header.php
is more compatible and easier than../../wp-blog-header.php
or whatever would be your syntax.
So just put them in separate folders.podz:
If you are in a different directory:
for example on my site the mp3 section is in url/mp3/
I copied header.php to that directory and fixed the path for wp-blog-header.php
the footer can be anywhere since it doesn’t have any requires in itclay,
Works good. The only change I made is in wp-includes/header.php, where I had to hard code the full path to wp-blog-header.php. If I didn’t, the header wouldn’t work in subdirectories.
On line 3 of wp-includes/header.php I changed:
require(‘./wp-blog-header.php’);
to:
require(‘/home/salenso/public_html/wp-blog-header.php’);
Hopefully this won’t cause troubles elsewhere.
ZRob,
Thank you also for your reply. Unfortunately, I’m not familiar with mod_rewrite but will look into it. I know only enough php to get by on basics, and don’t want to fudge it all up. I should really sit down and learn it all.Hey.. this stuff is cool 🙂
Thanks !!Here is what I did.
I did not split my template (a.k.a. index.php) in 3, I just used it to integrate other pages and/or integrate the blog in something else. Hmmm… this sounds so complicated even I have difficulties to understand it 🙂
So, I have a
subdomain.mydomain/index.php page with exactly the same layout as the wp-index
– I put the include wp-blog-header stuff in the top of it, modifying the relative path
– in the content/post div(s) I put my hardcoded text
– in the menu div I deleted everything I didn’t want to show up, keeping just the calendar
then I have my WP installed in a directory called
– mydomain.net/wp/
– I also included a “static page” in this directory (Why? is the link) again with exactly the same layout: deleted the Loop and copied my text; the menu is the same
– ONE small problem: if you click on the above mentioned link from a page viewed through permalink (e.g. mydomain/wp/archives/2004/09/19/post-title … it will try to add the static page (about.php) AFTER all this stuff. I guess I should use absolute path for that link.I did the split the index.php into 3 trick and it worked, but:
when I try to add more pages, using the header.php and footer.php in it, I get the following errors: What is wrong and how to fix it?
Fatal error: Call to undefined function: bloginfo() in /home/virtual/site27/fst/var/www/html/aa/wp-includes/header.php on line 9
and after the body content:
Fatal error: Call to undefined function: get_links_list() in /home/virtual/site27/fst/var/www/html/aa/wp-includes/footer.php on line 5
Line 9 of the header.php is:
<title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
and line 5 of the footer.php is:
<?php get_links_list(); ?>
Thanks for helping out,
BonelessYou need to alter the path in
‘require(‘./wp-blog-header.php’);’
Where are the new pages in relation to the blog directory ?i did alter the path, but the errors I mentioned are the errors I get after altering.
my blog is at http://www.boneless.nl/aa/
the new pages are in many subdirectories under http://www.boneless.nl/
(for instance: http://www.boneless.nl/popquiz/ and http://www.boneless.nl/tv/)
When you right now visit http://www.boneless.nl/aa/ the site looks ok, using the index.php split into three.
BUT: when I alter the path to wp-blog.header.php I get errors as well. When you then go to http://www.boneless.nl/aa/ you see this:
Fatal error: Call to undefined function: bloginfo() in /home/virtual/site27/fst/var/www/html/aa/wp-includes/header.php on line 9
and line 9 says:
<title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
any solution?And maybe for better explanation, this is the sample-page I’m trying to get to work with the index.php into 3-trick:
http://www.boneless.nl/popquiz/uitleg.phpAnd when I move the file to the main blog directory, it does work, except for the aligning of the text, see:
http://www.boneless.nl/aa/uitleg.php
I really don’t want to put all the files of my site in 1 directory, so how to fix this?
BonelessPertaining to this, how can you do this with the Kubrick template? I’m going to switch back to a simpler template, but if I can use Kubrick, I’d like to try to stay with it for a bit longer. (It’s still pretty nice!)
I haven’t modified the template at all really, so you can safely assume everything’s the same.
Thanks!I suppose I have some success attempting this. I’m still using Kubrick, although it’s not valid XHTML. I just wanted to see if I could do it before I had to leave for the afternoon – and I accomplished something.
If I really wanted to be able to edit those static pages in WP, I could just add them into the “Common Files” area. I still have to try again, from scratch, to see if I can keep things valid this time around.
I still wanted a horizontal menu below the banner instead. It’s fine for now – I hope.
Yay? *LoL*
– Bryan
- The topic ‘Integrating other pages in WordPress’ is closed to new replies.