• Hi there,

    I cannot figure this out but I’m sure its pretty simple.

    I have <?php the_permalink(); ?> pointing to a post on my site e.g. https://www.mysite.com/test-post

    What is the code for JUST “test-post”, i.e. without the “www.mysite.com”?

    I tried <?php the_title(); ?> but that brings up “Test Post”, not the correct suffix “test-post”

    Sorry for not posting my site, it’s not live yet but hopefully the question makes sense.

    Rob

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would not worry about the permalinks until the site is live and then just apply your permalinks settings in the admin dashboard, this functionality is built into WordPress as long as the slug is set.

    Thread Starter RobSamson

    (@robsamson)

    Unfortunately, there’s a reason that I need to have the slug only but I’ll save the explanation… do you know the answer?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Quick php permalink question – help much appreciated!’ is closed to new replies.