how to integrate wordpress into php website

WordPress is very easy to work on. PHP tutorial, how to integrate wordpress into php website. you can very easily integrate the wordpress with php or html site. Here we given code for same.

There may be only a few features of WordPress you want to use when integrating it with your site, or you may want your entire site run with WordPress. This tutorial will guide you through making your WordPress site look like your current design.

how to integrate wordpress into php website

How to start?
First you need to disable the wordpress theme. using following code.

open your header.php file from your wordpress theme and put following code in that file.

<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>

Create any php file and put following code in that file.

<?php
require('/the/path/to/your/wp-blog-header.php');
?>

In the event you want to show ten posts sorted alphabetically in ascending order on your web page, you could do the following to grab the posted date, title and excerpt:

<?php
require('/the/path/to/your/wp-blog-header.php');
?>

<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
how to integrate wordpress into php website

how to integrate wordpress into php website

For more information you can write to me.

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *