Variables

{{ slug }}

{{ slug }} prints the current WordPress slug.

Example#

phpresources/views/single.php
<article class="entry entry-{{ slug }}">  <h1>{{ title }}</h1></article>

Use it when markup needs a stable, URL-safe identifier from the current page or post.