WordPress - Assign a class or id to the body of a page/post


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <body class="<?php echo get_post_meta(url_to_postid($_SERVER['REQUEST_URI']), 'class', true); ?>">

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.