• I am fairly new to both WordPress plugins and php, but I want to modify a plugin to export certain posts (title, url and post contents) as a xml file. I have generated an array of the post IDs that I wish to export and I am using the get_permalink() and get_the_title() functions to return the url and title of the posts for use in the PHP code, eg.

    <?php get_permalink(ID); ?>
    <?php get_the_title(ID); ?>

    However, I’ve had a look through the documentation and had a search on the forum, but I can’t find a suitable function for the post contents. Is there one? Ideally, I want a get_the_post_contents(ID) like function that returns the post contents as a string for the specific post ID, and used outside The Loop.

Viewing 1 replies (of 1 total)
  • Thread Starter fidra

    (@fidrabooks)

    bump

    If this is the wrong forum for my question, can someone let me know so I can x-post.

Viewing 1 replies (of 1 total)
  • The topic ‘return post contents for use in php’ is closed to new replies.