views:

96

answers:

4

I'm putting together a web site that needed to include some signup and blogging capability. Wordpress seems to be a perfect fit for that portion of the app, so I've started experimenting with it. I see plenty of tutorials on creating custom themes so I don't expect that to be a problem.

What I'm not able to figure out is what to do with the rest of my site. I will have other non-blogging related php pages that will access a database, etc. I see that wordpress has a capability for generic pages of static content, but these would need to be coded PHP pages. I just can't find a way of having the wordpress theme apply to other php pages outside of wordpress. I was hoping of just doing something like

wp_header();
blah blah
wp_sidebar();
blah blah
wp_footer();

but I'm not really seeing any examples or documentation on how this might be done. Am I missing a key piece of documentation?

EDIT: The answer is to essentially copy and paste a file from the theme, with one crucial addition:

require( dirname(__FILE__) . 'path_to_wp_root/wp-load.php');

That sets up the wordpress environment and allows me to call get_header(), get_sidebar(), get_footer(), etc.

A: 

What you should do is develop your other non-blogging related php pages as a wordpress plugin. There are plenty of references online on how to do this, for example:
http://www.tutorialized.com/view/tutorial/Creating-a-Custom-Wordpress-Plugin-from-Scratch/41834

Joel Martinez
+1  A: 

Generally, "yes".

A well-designed WordPress theme uses mostly CSS/Stylesheets for display, and you are correct in your assumptions: Look through the "Codex" about Theme Design / Template Design (http://codex.wordpress.org/Stepping_Into_Templates).

Essentially you could base your design on some of the current theme files, but leave out "the loop".

anonymous coward
I'm not quite sure I understand...are you saying I should build out the entire rest of my site in the themes folder? That doesn't sound right...
Clyde
oh wait...I think I get it now....the missing piece is the wp-load script
Clyde
There could be several ways to do it. If you wanted to keep the WP sidebar, you'd just need to be sure you could call the functions that create the sidebar. If you only wanted the basic "theme" (colors, fonts, layout) you could simply access the stylesheet files.
anonymous coward
+1  A: 

I think what you really want to do is include wp-load.php at the top of your php file. This will give you access to all the wordpress functions (wp-header(), wp-footer(), etc).

Peter
A: 

Another option is to use Wordpress as the CMS for all content on your site. This is increasingly becoming popular, as Wordpress is quite good at non-blog-things these days.

singpolyma