Wordpress: Slug as string


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $post_data = get_post($post->ID, ARRAY_A);
  3. $slug = $post_data['post_name'];
  4. echo $slug;
  5. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.