• I have a wierd problem.
    If I inspect my WP pages using chrome element inspector I see two body tags thus:

    `<body cz-shortcut-listen=”true”>
    <body>`

    This is causing styling and JS problems.
    If I view source then just a single

    <body>
    is displayed with no classes.

    No classes from body_class() are displayed in either view but I can echo them out into the source quite happily when they are not within this line in header.php

    <body <?php body_class();?>>
    simply adding

    <?php body_class();?>
    above or below that line displays all the body classes quite happily so they are being set.

    If I comment out the line in header.php that writes the body using php commenting this body tag is still rendered

    <body cz-shortcut-listen="true">

    This happens with all themes and also to users outside of my local network and in chrome AND firefox so it seems not to be a theme or local browser issue.

    Has anyone any idea what it might be, it is a major headache and I’m quite stumped as to what it could be or how to even go about working out what the problem is.

    Just for info:
    Server is running Apache/2.2.29
    PHP/5.3.29
    Mysql 5.5.42
    amazon Linux on an EC2 m3.medium instance.

    You can see a staging site here:
    https://eco.clearintent.co.uk/

    Thanks,

    Paul

Viewing 6 replies - 1 through 6 (of 6 total)
  • web search for ‘cz-shortcut-listen’ gives a list of related answers;

    for example, one of them:
    https://stackoverflow.com/questions/13147210/html-body-says-cz-shortcut-listen-true-with-chromes-developer-tools

    Thread Starter tofuwarrior

    (@tofuwarrior)

    Thank you for your reply, I appreciate you taking the time to look but a more complete reading of my post would have indicated that this is not the issue I am asking about.
    Naturally, as you did, I searched google to investigate this ‘cz-shortcut-listen’ body tag attribute and also found the plethora of links you found indicating that it relates to colorzilla.

    The issue in question is the duplicate body tags causing issues with css and JS.
    From my post – “If I inspect my WP pages using chrome element inspector I see two body tags”

    This issue is unrelated to colorzilla or in fact any browser issue I can track down.

    From my post – “This happens with all themes and also to users outside of my local network and in chrome AND firefox so it seems not to be a theme or local browser issue.”

    Do you have any ideas about this duplicate body tag issue?

    Thread Starter tofuwarrior

    (@tofuwarrior)

    UPDATE:
    I have installed a vanilla wordpress installation on a brand new ec2instance running apache 2.4 and have exactly the same issue.
    Very very odd.
    Anyone? This is driving me mad.

    Thread Starter tofuwarrior

    (@tofuwarrior)

    If I use wget, the issue does not occur. What is this telling me?

    Thread Starter tofuwarrior

    (@tofuwarrior)

    Disabling javascript in chrome does not stop the additional <body> appearing.

    Thread Starter tofuwarrior

    (@tofuwarrior)

    See this Stack exchange question for further updates on this bizarre issue.
    https://wordpress.stackexchange.com/questions/198563/two-body-tags-on-all-wp-pages-regardless-of-theme

    In summary:
    The issue is based in strange characters being present or inserted into the body tag when rendered.
    However there are further quirks to when this happens and when the body tag renders properly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘2 body btags and body_class() classes not displaying’ is closed to new replies.