Return to Snippet

Revision: 29467
at July 30, 2010 05:37 by S_Park


Updated Code
<?php
	$post_data = get_post($post->ID, ARRAY_A);
	$slug = $post_data['post_name'];
	echo $slug;
?>

Revision: 29466
at July 30, 2010 00:47 by S_Park


Initial Code
<?php
function the_slug() {
	$post_data = get_post($post->ID, ARRAY_A);
	$slug = $post_data['post_name'];
	return $slug;
}
echo the_slug();
?>

Initial URL
http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function

Initial Description


Initial Title
Wordpress: Slug as string

Initial Tags
wordpress

Initial Language
PHP