Forums

Call the Postname into HTML file? (2 posts)

  1. djones101
    Member
    Posted 3 years ago #

    Hi,

    I created a custom template. I would like to be able to call the %postname% into the HTML file.

    I am currently using the <?php the_title(); ?> To achieve the basics of what I am wanting to do, but It is annoying to Put a "-" in my titles. Anyone know how I can call the postname in the HTML file?

    Thanks

  2. stvwlf
    Member
    Posted 3 years ago #

    Hi

    Apparently this will work

    global $post;
    echo $post->post_name;

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags