WordPress.org

Ready to get started?Download WordPress

Forums

Get post slug (3 posts)

  1. vernikr
    Member
    Posted 7 years ago #

    How can I get the post slug in php code?

  2. whooami
    Member
    Posted 7 years ago #

    <?php permalink_anchor(title); ?>

    read the codex for more info, you have to use that within the loop.

  3. vernikr
    Member
    Posted 7 years ago #

    I write
    <?php permalink_anchor(title); ?>
    just after the beginning of the loop
    <?php if (have_posts()): while(have_posts()) : the_post(); ?>
    but have no result.
    If I use any another function (ex. the_ID) the result will be. Is something wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags