Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deckerweb/d03269e18c567d153251e39cb9b5072d to your computer and use it in GitHub Desktop.
Save deckerweb/d03269e18c567d153251e39cb9b5072d 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