Skip to content

Instantly share code, notes, and snippets.

@israelcurtis
Created September 28, 2012 06:57
Show Gist options
  • Save israelcurtis/3798347 to your computer and use it in GitHub Desktop.
Save israelcurtis/3798347 to your computer and use it in GitHub Desktop.
Use the get_post_field() function to get any of the wp_posts column fields #wordpress #php
<?php
echo get_post_field('post_content', $post_id); // retrieve content
echo get_post_field('post_name', $post_id); // retrieve the slug
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment