php - Display WordPress posts on external webpage -


I'm running WordPress functions on an external webpage to get posts and pages. The function works fine.

I'm using

  the_content ();  

to display the body of posts, but this does not seem like keeping the correct formatting. HTML is displaying fine, but line breaks are not etc.

Here is the full PHP code I am using:

  $ page = get_page_by_id ($ _ get ["p"], object, 'post'); Query_posts ('P =' $ page- & gt; id ''.); If ($ page-> ID) {while (is_posts ()) {the_post (); ? & Gt; & Lt; H2 & gt; & Lt ;? Php the_title (); ? & Gt; & Lt; / H2 & gt; & Lt; Br> Posted on & lt ;? Php the_date (); ? & Gt; & Lt; Br> & Lt; Br> & Lt ;? Php the_content (); Screenshot of your site:    

Screenshot of the Wordpress template:

It seems that the required CSS information is missing. H2 & gt; and & lt; You need to include CSS & lt; p & gt; Tags from WordPress templates


Comments