Hi guys
We have a plugin to schedule page content updates installed. Unfortunately it will change the page-id. Do we have an alternative to this otherwise all JS snippets and CSS styles will stop working.
If we could move an ID into the page, this would work, cause we can control that part.
Thanks for the input.
Kr, Jay
maybe it is best to ask the plugin developer why the page-ids change on that.
The plugin will create a new page and then replace the old page. So while it is scheduled there are two pages with the same title in the pages list. After the scheduled time has passed, the original page is gone and the new one took its place.
BR, Jay
maybe this little snippet in child-theme functions.php helps you to have on body (#top) the page/post name as new class:
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );
f.e.
a page “Contact” will have then the class at body: page-contact
a portfolio “news” will get portfolio-news
etc.