RickEpnet
asked on
Embed Wordpress Blog into my Web Site
I have a Web Site and PHP works fine on it and I have a Wordpress blog.
Path is as follows websiteroot/blog
This is on a Windows server. The blog it self works fine
www.epnetworking.com/blog
I have a page like this but nothing shows up. Here is the test page. I found this code while search for a way to do this.
*****************Start Code********************** **
<html>
<head>
<title> PHP Test Script </title>
<?php require_once”./blog/wp-loa d.php”; ?>
</head>
<body>
<?php get_header();?> // Get the header of your new blog template
<?php query_posts(‘showposts=3') ;?> // You can set the number of post to show
<?php while (have_posts()): the_post(); ?>// The while loop to show the post
<h2><?php the_title(); ?></h2>// Show the title of the post…
<?php the_content();?>// Show the content of the post…
<?php endwhile; ?>// end of while loop
<?php
get_sidebar(); // Get the side bar of your blog template
get_footer(); // Get the footer of your blog template
?>
</body>
</html>
**********************End Code****************
Path is as follows websiteroot/blog
This is on a Windows server. The blog it self works fine
www.epnetworking.com/blog
I have a page like this but nothing shows up. Here is the test page. I found this code while search for a way to do this.
*****************Start Code**********************
<html>
<head>
<title> PHP Test Script </title>
<?php require_once”./blog/wp-loa
</head>
<body>
<?php get_header();?> // Get the header of your new blog template
<?php query_posts(‘showposts=3')
<?php while (have_posts()): the_post(); ?>// The while loop to show the post
<h2><?php the_title(); ?></h2>// Show the title of the post…
<?php the_content();?>// Show the content of the post…
<?php endwhile; ?>// end of while loop
<?php
get_sidebar(); // Get the side bar of your blog template
get_footer(); // Get the footer of your blog template
?>
</body>
</html>
**********************End Code****************
You can also do it with IFrame and the RSS Feed
ASKER
I would rather not use iframe and rss feeds I understand how to do that but I would rather use wp-load but I cannot seem to get it to work.
Selvol I tried this but it did not work. Where on the page should this code go. Head, body etc.?
<?php
require "../wp-load.php";
?>
Selvol I tried this but it did not work. Where on the page should this code go. Head, body etc.?
<?php
require "../wp-load.php";
?>
Assuming the page is on the top level of the site, try
<?php require_once ”blog/wp-load.php”; ?>
<?php require_once ”blog/wp-load.php”; ?>
ASKER
I get a blank page.
Here is the page
http://www.epnetworking.com/test.php
Here is my Blog
http://www.epnetworking.com/blog
Here is what is in test.php
************************** ********** ******
<html>
<head>
<title> PHP Test Script </title>
<?php require_once ”blog/wp-load.php”; ?>
</head>
<body>
</body>
</html>
************************** ********** ******
Here is the page
http://www.epnetworking.com/test.php
Here is my Blog
http://www.epnetworking.com/blog
Here is what is in test.php
**************************
<html>
<head>
<title> PHP Test Script </title>
<?php require_once ”blog/wp-load.php”; ?>
</head>
<body>
</body>
</html>
**************************
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!
It still did not work.
You can see at http://www.epnetworking.com/test.php
I pasted what you posted into the test.php
Could it be something to do with Wordpress?
It still did not work.
You can see at http://www.epnetworking.com/test.php
I pasted what you posted into the test.php
Could it be something to do with Wordpress?
Unlikely.
I just noticed that your original code block (which I modified) appears to have fancy quotes and that may screw things up. Can you fix those to normal ' and " ?
I just noticed that your original code block (which I modified) appears to have fancy quotes and that may screw things up. Can you fix those to normal ' and " ?
ASKER
Thank you so much the Quotes are what was wrong.
require "../wp-load.php";
?>
Selvol