Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // If title is not displayed before loading the header, Wordpress displays "Page not found" as the title
- echo "<head>
- <title>I test somthing</title>
- </head>";
- // Wordpress path (if wordpress is not located at ROOT//
- $wplocalpath="/Wordpress1";
- // Include the Main Wordpress blog header
- include $_SERVER['DOCUMENT_ROOT'].$wplocalpath."/wp-blog-header.php";
- //Now, you need to get the active theme's folder, and get a relative path to that folder
- $homeurl=home_url();
- $ddir= get_bloginfo( 'template_directory');
- $current_theme_relative_path=substr_replace($ddir, "", 0, strlen($homeurl));
- //echo "<br/>The relative path to the currently active theme is ".$current_theme_relative_path;
- //Once you have the path, include the header and footer, adding your custom php code in between.
- // Include the specific theme header you need
- include $_SERVER['DOCUMENT_ROOT'].$wplocalpath.$current_theme_relative_path."/header.php";
- // Your custom PHP code STARTS here
- // Add anything you want to display to the user
- echo "
- <h2>
- Your form has been submitted
- </h2>";
- // END of custom code
- // Now end with the theme's footer
- include $_SERVER['DOCUMENT_ROOT'].$wplocalpath.$current_theme_relative_path."/footer.php";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement