Tag: wordpress

  • WordPress Function add_theme_support( ‘html5’ ) was called incorrectly

    An annoying message appeared yesterday when we migrated a customer website to a new server.

    Notice: Function add_theme_support( ‘html5’ ) was called incorrectly. You need to pass an array of types.

    The site is an older build but seemed to be working in every other respect. So a quick dive into the WordPress documentation for add_theme_support() confirmed that the old theme was using an old format of the add_theme_support function. Checking within the theme files identified the offending line and offered a quick fix.

    // Add HTML5 markup structure
    // 20230417 thowden : this format is incorrect. 
    //add_theme_support( 'html5' );
    // it should call with an array like this:
    add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script' ) );
    // end thowden

    The above modification was made and the site runs smoothly again. The actual details of the theme and the specific file are not relevant as this could affect any older WordPress theme install.

  • WordPress wp-admin missing gui

    When moving WordPress sites around on servers and from a staging setup to live, we sometimes get bitten with “wordpress wp-admin missing gui” where the public view of the site is working fine, but the wp-admin areas shows up as plain text or simple html. You may not have seen it before, but plain white background and all the dashboard selections are simple links, like the theme is missing.

    Having gone through this several times in the last 4 or 5 weeks, I have decided I need to document what I tried and what worked in the end for the latest site issue. It could be different things and while I did not make a note the last few times, I’ll come back here in future if something different happens.

    We use CPanel for all our hosting servers and the WordPress Toolkit is installed.

    The task was a simple swap from staging to live which I do on a regular basis, and do it manually, as I have done for numerous years. However this time the dreaded “wordpress wp-admin missing gui” struck!

    Skipping the intervening hour of trying a multitude of settings, I discovered that this site was impacted by one of the WordPress Toolkit security settings. Which one, I do not know, as the final outcome was to revert or reset all the security settings and then enable 1 by 1 waiting to see which one failed, and none did!. Bah humbug.

    The outcome is then likely that somewhere in those settings, as I had copied the site manually into the public_html, had some setting that tied it back to the staging location, and ultimately crashed the theme. I expect that clearing the security settings (Revert) and re-enabling in one hit would have addressed the issue, but as with many things, we try incremental changes. If it happens again, I will try that first.