displaying wordpress content on external webpage with correct formatting

I have created a function in wordpress that retrieves a page by the post_name, the function is working fine however when i call the function on my external website and display the page/post content the formatting is incorrect.

Here is how i display it:

Read More
$page = get_page_by_post_name($_GET["id"], OBJECT, 'page');
query_posts('p='.$page->ID.'');
echo '<div id="page-title">'.$page->post_title.'</div>';
echo $page->post_content;

So i format the text and images in the wordpress editor and then when they display, its just one big block of text. any ideas?

Here is the CSS I have on my external page:

html,body {
    margin:0;
    padding:0;
    overflow-x:hidden;
    font-family:Arial;
    height: 100%;
}
h1, h2, h3, h4, h5, h6 {
    clear: both;
    font-weight: 700;
    margin: 36px 0 12px;
}
h1 {
    font-size: 26px;
    line-height: 1.3846153846;
}
h2 {
    font-size: 24px;
    line-height: 1;
}
h3 {
    font-size: 22px;
    line-height: 1.0909090909;
}
h4 {
    font-size: 20px;
    line-height: 1.2;
}
h5 {
    font-size: 18px;
    line-height: 1.3333333333;
}
h6 {
    font-size: 16px;
    line-height: 1.5;
}
h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
    margin-top: 0;
}
p {
    margin: 0 0 24px;
}

Related posts

Leave a Reply

1 comment

  1. You have to write the css code for external webpage for styling the content. In wordpress also there is no Default Style for this. Theme css file would have all styles for this