tareq1988 / wedocs

A documentation theme for WordPress
http://docs.wedevs.com
394 stars 129 forks source link

No CSS with Wordpress 5.3.2 #59

Open Baptistecottey opened 4 years ago

Baptistecottey commented 4 years ago

Hello,

Since i have updated my Wordpress to last version ( 5.3.2 ) it looks the CSS of wedocs isn't loaded : image

I'm using the last plugins version.

thebengalboy commented 4 years ago

Do you use the weDocs theme? If yes, try changing to a default WordPress theme.

Baptistecottey commented 4 years ago

Hello,

On the front website yes i'm using weDocs theme. On admin this is the default wordpress admin template.

thebengalboy commented 4 years ago

Try changing the weDocs theme, it's not compatible with the latest WordPress. Switching to any default WordPress theme might help.

Baptistecottey commented 4 years ago

Yes, you're right.

It works with default Wordpress theme.

Do you plan to update weDocs theme ?

thebengalboy commented 4 years ago

We have a different plan. Stay with us :)

Thanks

Baptistecottey commented 4 years ago

Glad to hear it ! Thank you :)

kamilszmit commented 4 years ago

Not loading the styles is caused by errors:

Notice: Undefined offset: 0 in wp-content/themes/wedocs-develop/lib/cleanup.php on line 96
Notice: Undefined offset: 0 in wp-content/themes/wedocs-develop/lib/cleanup.php on line 97

The errors also cause styles of different plugins not to load in the WordPress admin panel. The problem is solved by modifying the function 'wedocs_clean_style_tag'. Please change the line of the script 'lib/cleanup.php' of the theme 'weDocs':

    $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media="' . $matches[3][0] . '"' : '';
    return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";

into:

    if (array_key_exists(3, $matches) && is_array($matches) && array_key_exists(0, $matches[3]))
    {
        $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media="' . $matches[3][0] . '"' : '';
        return '<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
    }
    else
    {
        return $input;
    }
Baptistecottey commented 4 years ago

Hello @kamilszmit

It works !

Thank you for your fix :)

thebengalboy commented 4 years ago

Hello @kamilszmit

You can create a pull request to contribute to weDocs. I believe that will help a lot of people who use and loves weDocs :)

Thanks