How do you extract image and content (& URL) from a WP Blog?
Posted: Fri Jun 10, 2016 4:51 am
We are trying to do something we have never attempted - to echo on the top level of a website, some content from it's Wordpress blog.
We want to show the last 3-4 blog posts, it's title, a portion of it's content, when it was published, any category, and the "featured image", along with a URL that goes directly to it's page.
I know the URLs are controlled by it's "permalinks". Can I extract the URL of a Post somehow??
How do I get the URL of the image, that's being used as the featured image?
Finally, the content of a blog is in HTML, so will have <p> tags. But if I take just a portion of it, I'm sure the <p> tag won't have an end, so maybe I need to manually add one at the end of my code anyway.
The title and dates are pretty simple I know. It's the other two parts I am having trouble with.
Thanks
We want to show the last 3-4 blog posts, it's title, a portion of it's content, when it was published, any category, and the "featured image", along with a URL that goes directly to it's page.
I know the URLs are controlled by it's "permalinks". Can I extract the URL of a Post somehow??
How do I get the URL of the image, that's being used as the featured image?
Finally, the content of a blog is in HTML, so will have <p> tags. But if I take just a portion of it, I'm sure the <p> tag won't have an end, so maybe I need to manually add one at the end of my code anyway.
The title and dates are pretty simple I know. It's the other two parts I am having trouble with.
Thanks