Global Header Content Disappeared Across all Network Sites with v1.8.3.1

Hello,

After updating to Ultimate Branding from v1.8.3 to v1.8.3.1 my Global Header content has completely disappeared across all Network sites.

A page where the global header appears as intended...red bar at the top (v1.8.3) [staging site]

A page on a separate install where the custom header content is missing...no red bar at the top (running v1.8.3.1)

Here is the code I am using for the Custom Header Content, implemented on both sites above:

<div class="GLOBALheader">
<div class="GLOBALheaderitembox">
<div class="GLOBALheaderitems">
<ul>
 	<li class="left">Welcome to UST Blogs</li>
 	<li class="right"><a href="http://stthom.edu" target="_blank">back to stthom.edu</a></li>
</ul>
</div>
</div>
</div>

On the site where the Custom Header Content isn't rendering, I also have an "Uncaught SyntaxError: Unexpected identifier" in the browser inspector console for the following line:

node.innerHTML = "<div class=\"GLOBALheader\">\r\n<div class=\"GLOBALheaderitembox\">\r\n<div class=\"GLOBALheaderitems\">\r\n<ul>\r\n \t<li class=\"left\">Welcome to UST Blogs<\/li>\r\n \t<li class=\"right\"><a target="_blank" href=\"http:\/\/stthom.edu\" target=\"_blank\">back to stthom.edu<\/a><\/li>\r\n<\/ul>\r\n<\/div>\r\n<\/div>\r\n<\/div>";

Since this is happening on v1.8.3.1 and not v1.8.3 perhaps the "Fixed: Issue with the global header." line in the v1.8.3.1 changelog is the likely culprit?

Thanks!

  • Kasia Swiderska

    Hello Rone,

    Do you have minification enabled on that sites where global header is not working? If yes could you disable it and see if this start to work?

    I tested your code on my site and it works correctly - Ultimate Branding is using this JS script to apply that custom code in right place so it wont be dependent on the theme.

    If minification is not cuplrit would you mind allowing support access so we can have a closer look at this?
    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    kind regards,
    Kasia

  • Rone

    Hi Kasia,

    Thanks for your reply. I completely turned off Hummingbird's minification tool but am still faced with the same issue. I also didn't see the custom header JS in the list of minified code/files in Hummingbird. Even after turning off minification, the JS in question is unchanged as far as I can tell.

    One thing I did notice is that Ultimate Branding using JS to render custom header content is something new with version 1.8.3.1, correct? Previous versions (like 1.8.3) just embed the code as-is in the page source. Interestingly, Ultimate Branding's custom footer content is not implemented via JS and is just placed as-is.

    With the switch to custom header content being implemented via JS added in the page footer, I suppose its possible that this could be conflict with other JS being used on the site.

    I'll wait to see what you guys come up with, but for those of us who already implement a lot of custom JS on our sites, it might be nice to have the option to decide how Ultimate Branding custom content headers and footer content modules are implemented (JS or as-is).

    I'm tempted to simply revert back to 1.8.3 to see if the JS implementation is the problem here, but I'll hold off for now.

    I have also granted the support access your requested as per the WPMUdev manual you linked to.

    Thanks

  • Nithin

    Hi Rone,

    Hope you are doing good today.

    One thing I did notice is that Ultimate Branding using JS to render custom header content is something new with version 1.8.3.1, correct? Previous versions (like 1.8.3) just embed the code as-is in the page source. Interestingly, Ultimate Branding's custom footer content is not implemented via JS and is just placed as-is.

    Yes, JS to render Global Header Content is something new in version 1.8.3.1. Hummingbird plugin doesn't minify inline JS, or styles, so you'll notice such code placed as it is.

    I gave a closer look at the issue, and I'm not able to replicate such issue in my system. Further checking your system, the console error points to a syntax error:
    Uncaught SyntaxError: Unexpected identifier

    What I was able to notice is that, some other script in your install is adding an extra target="_blank" to a tags, and hence causing this issue.

    That is the following line:

    <li class="right"><a href="http://stthom.edu" target="_blank">back to stthom.edu</a></li>

    When the above line is encoded, and parsed, a script somehow is adding an extra target attribute like:
    <strong><a target="_blank" href=\"http:\/\/stthom.edu\" target=\"_blank\">back to</strong>

    You'll notice target being defined twice in the above code, so that's causing the issue here, if you omit the a tag in the header it works fine:

    <li class="right">back to stthom.edu</li>

    So either a plugin, or a code from your theme is adding extra target="_blank" attribute to the tags, would recommend you to run a quick plugin/theme conflict test as illustrated in getting support manual (flowchart), and check which script is causing this, so that we could have a better idea regarding this issue.
    http://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Please let us know how that goes, so that we could give a closer look, if needed. Have a nice day.

    Kind Regards,
    Nithin

  • Rone

    Hi Nithin,

    Thanks for the reply. I did have some functions.PHP code that automatically added added target="_blank" to URLs that went off of domain. This was at the request of the client.

    While disabling this code fixes the issue, this wasn't a problem for any previous versions of Ultimate Branding until v1.8.3.1 started using JS to handle placing custom header code in the source.

    So I would still like to see an option where we aren't forced to use javascript to place content (my content in the page code is the simplest of HTML) and instead just have at least an option to have content placed in header like it was prior to v1.8.3.1 (as-is).

    Thanks again for all the help.

  • Rupok

    Hi Rone,

    I would still like to see an option where we aren't forced to use javascript to place content (my content in the page code is the simplest of HTML) and instead just have at least an option to have content placed in header like it was prior to v1.8.3.1

    Thanks for letting us know your suggestion. I'm moving your thread to our Features and Feedback section. More people liking this idea, more chances our developers will work on this and will bring that feature back in our future releases.

    Have a nice day. Cheers!
    Rupok