0

I have two websites, and I want to embed the content of one post on one of these sites, into a post in the other site.

I have looked at various plugins but can't find anything that works.

I can embed the entire page with this code:

<object data=http://www.pg-mysite.com/squares width="650" height="500"> <embed src=http://www.pg-mysite.com/squares width="650" height="500"> </embed></object>

But I only want the content to appear, not the headers, footers, sidebars etc.
Is there a way to get just the post content?

1
  • My thought is the process like yours: I think <iframe> with some javascript code or, simple CSS display:none; can work with ease. – Mayeenul Islam Aug 25 '13 at 14:23
1

WordPress generates a large number of RSS feeds. For a single post the URL for that feed is the single post URL plus /feed/ or ?feed=rss2 if pretty permalinks are off. If you try that you will see the comments feed, though, and not the post itself. To get the post itself add ?withoutcomment=1 or &withoutcomments=1 and you will get the post content itself. Have your other site request that feed, whether by AJAX or some PHP function like curl-- whatever you have available to the requesting site-- and process the XML to display it however you like.

Not the answer you're looking for? Browse other questions tagged or ask your own question.