WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Page Slug and Category Call (3 posts)

  1. bradstinyworld
    Member
    Posted 7 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 7 years ago #

    hi

    1) slug: echo $post->post_name;

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

  3. Herudea
    Member
    Posted 7 years ago #

    Thanks. was needing the slug.

Topic Closed

This topic has been closed to new replies.

About this Topic