php - How to show slug on HTML id in Wordpress -


i trying id have slug such id="the_title" if title title. such use custom css n js things specific post. can using php want know if there wordpress specific code in word or two.

the_title() 

here want that

<h3 class= "serviceslist" id="what put here post's slug"><?php the_title(); ?> : <a href="#"><i class="fa fa-chevron-down"></i></a></h3> 

there's no built-in function displaying slug. however, can global $post object:

<h3 class= "serviceslist" id="<?php echo $post->post_name ?>">     <?php the_title() ?> : <a href="#"><i class="fa fa-chevron-down"></i></a> </h3> 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -