Use WordPress theme functions externally.

If you want to call any wordpress function outside , you need to have access of its wp-load.php file which load all wordpress functions.

Suppose, you want to display header and footer of wordpress website in your web browser.

1. Create index.php

2. Copy, this code to index.php file which fetch its parts.

<?php
define('WP_USE_THEMES', false);
require('blog/wp-load.php');
get_header();
get_footer();
?>

You can call any part of wordpress like sidebar but you just need to find out its function name and call it in the required file.

Cheers!

1 thought on “Use WordPress theme functions externally.”

Leave a Reply

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