Posted By

jimmysessions on 01/21/09


Tagged

template page wordpress slug


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

umang_nine
tmbrenneke
pauloc
lancemonotone


Wordpress get page slug


 / Published in: PHP
 

URL: http://wenderhost.com/2007/08/09/wordpress-tip-find-the-current-page-slug/

  1. $post_obj = $wp_query->get_queried_object();
  2. $post_ID = $post_obj->ID;
  3. $post_title = $post_obj->post_title;
  4. $post_slug = $post_obj->post_name;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: dsheetz on July 24, 2009

what version of wordpress does this apply to? does it have to be "inside the loop"?

Posted By: n0ta on October 8, 2010

Nice! Thank you!

You need to login to post a comment.