Skip to content

Instantly share code, notes, and snippets.

@layoutph
Created March 14, 2015 02:48
Show Gist options
  • Save layoutph/e150adaef0c33779a1dd to your computer and use it in GitHub Desktop.
Save layoutph/e150adaef0c33779a1dd to your computer and use it in GitHub Desktop.
Echo Post Slug
function the_slug() {
$post_data = get_post($post->ID, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}
Once done, simply call the function within the loop to get the post or page slug.
<?php echo the_slug(); ?>
Get thumbnail image as declared in Set as featured image
$yeah = get_the_post_thumbnail( $post_id, 'thumbnail' );
echo $yeah;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment