Integrating WordPress in a Static Page

Posted by beThinker | Posted in WordPress | Posted on 03-06-2009

WordPressTo incorporate or integrate WordPress with your static front page. You can include the HEADER, SIDEBAR, FOOTER, and even a mini-version of the Wordpress Loop.

How to include a Header

To include the header from your WordPress Theme you must add code below to the top of the page and using the folder path name you installed WordPress into.

Here is the code:

1
2
3
4
5
<?php
define('WP_USE_THEMES', false);
require('./wordpress/wp-blog-header.php');
get_header();
?>

The purpose of requiring or including wp-blog-header.php is to let you use of any WordPress function or template tag.

Note: In rare cases declaring the WP_USE_THEMES constant to false may produce non-CSS formatted page output.

How to Include The Sidebar or Footer
To add the sidebar and/or footer from your WordPress Theme, include one or both of the following code:

include this at the right container of your WordPress Theme:

1
<?php get_sidebar(); ?>

include this at the bottom of the page:

1
<?php get_footer(); ?>

I hope this tutorial is helpful.

Sponsored Links

Comments:

Write a Comment