Ever wondering if you could use WordPress functions in your None-WordPress site, for example, show latest post in your site footer?
This is easy. Add the following code to your site’s header, and you can freely use any function available in wp.
1 2 3 4 5 6 7 8 | <?php define('WP_USE_THEMES', false); require('./wp-blog-header.php'); ?> |
if your blog is on different directory than your site root add:
1 2 3 4 5 6 7 | <?php require('/wordpress site url/wp-blog-header.php'); ?> |
At Riski sometimes customers wants responsive customized PHP site, so with this technique their site will be more powerful.