Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1255302

    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

    #1255342

    maybe it is best to ask the plugin developer why the page-ids change on that.

    #1255406

    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

    #1255417

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.