Title: Get Post slug with a WordPress function
Last modified: August 18, 2016

---

# Get Post slug with a WordPress function

 *  [potter_system](https://wordpress.org/support/users/potter_system/)
 * (@potter_system)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/get-post-slug-with-a-wordpress-function/)
 * I’m playing with `in_category` and `switch` for change the presentation of some
   post (inside the loop, of course). Some posts will have a image; then, I want
   to know how can I get the Post Slug with a WordPress default funcion for use 
   it beyond the permalink.
 * Example:
    **Post title:** Juan Correa **Post slug:**juan-correa **Code**: ` <
   h1>Post title</h1> <img src="images/fichas/Post slug">  That’s all

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/get-post-slug-with-a-wordpress-function/#post-199299)
 * Just echo it through the $post array:
 * `<img src="images/fichas/<?php echo $post->post_name; ?>">`

Viewing 1 replies (of 1 total)

The topic ‘Get Post slug with a WordPress function’ is closed to new replies.

## Tags

 * [post-slug](https://wordpress.org/support/topic-tag/post-slug/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/get-post-slug-with-a-wordpress-function/#post-199299)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
