Obtenga la ID de página actual en WordPress
$page_id = get_queried_object_id();
Smoggy Skipper
$page_id = get_queried_object_id();
body { background-color: red; }
.page-id-1 body, .page-id-2 body , .page-id-3 body {
background-color: green!important;
}
$(document).ready(function() {
if ($("body").hasClass("page-id-3202")) {
//code here
}
});
Finding and adding id to body class