• Is there something i can use like this <?php the_title(); ?> for my “post slug”?

    would it be something like:

    <?php post_slug(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php echo $post->post_name; ?> is one way.

    Thread Starter webtodd

    (@webtodd)

    Thanks, that worked!

    I have another post slug question…

    When I create a post about something with a “.” in it, and name it something like “Website.com” – my default post slug is “websitecom” – is there a way to change logic behind the default post slug?

    yes. you can hook into sanitize_title. I beleive the default function that filters it in wp is sanitize_title_with_dashes. you can remove_filter() that and create your own “sanitize” filter (afaik).

    I now MarkJaquith did a plugin
    to allow periods in slugs.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to insert post slug name into post?’ is closed to new replies.