Created
March 14, 2015 02:48
-
-
Save layoutph/e150adaef0c33779a1dd to your computer and use it in GitHub Desktop.
Echo Post Slug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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