WordPress.org

Ready to get started?Download WordPress

Forums

Page Slug and Category Call (3 posts)

  1. bradstinyworld
    Member
    Posted 5 years ago #

    Two questions from me. Is there a call where I can display the page slug on the page? Secondly, how would I write a conditional statement to display the the category in the header on single posts, but leave it blank on everything else?

  2. stvwlf
    Member
    Posted 5 years ago #

    hi

    1) slug: echo $post->post_name;

    2) display on single posts: if (is_single()) { whatever }

  3. Herudea
    Member
    Posted 5 years ago #

    Thanks. was needing the slug.

Topic Closed

This topic has been closed to new replies.

About this Topic