1
REQUIRED: .wp-caption css class is needed in your theme css.
REQUIRED: .wp-caption-text css class is needed in your theme css.
REQUIRED: .sticky css class is needed in your theme css.
REQUIRED: .screen-reader-text css class is needed in your theme css. See See: the Codex for an example implementation.
REQUIRED: .gallery-caption css class is needed in your theme css.
REQUIRED: .alignright css class is needed in your theme css.
REQUIRED: .alignleft css class is needed in your theme css.
REQUIRED: .aligncenter css class is needed in your theme css.

I am getting the above error when I am running the theme-check plugin, but the problem is that I don't have any use of these classes in my theme. what should I do? Just use them for the sake of only getting rid of errors? Please guide me.

3

The theme check plugin checks your theme also for any default class that is generated by WordPress itself. Take a look into codex for some more info.

All you have to do, is to cover these classes in your CSS file, for example:

.alignleft {
    text-align:left
}

This will remove the errors from theme checker plugin.

  • Yes, I was thinking about that, but don't you think that this will generate not needed CSS? – The WP Intermediate May 25 '17 at 19:15
  • 1
    These classes are used by native WordPress functions. For example, if you align an image in your post to the left, WordPress will automatically add an alignleft class to the image, without you even knowing about it. So i would suggest you cover them all, you never know what happens later :) – Jack Johansson May 25 '17 at 19:16
  • 1
    @TheWPNovice Yes sir that is what you should do. Some markets such as envato won't even let you publish your theme if you don't cover these classes. – Jack Johansson May 25 '17 at 19:18
  • 2
    @TheWPNovice No it's not really fooling. These classes will be used somewhere, they are automatically added and used, and their name represents what they do. So covering them is necessary and is actually a neat work rather than fooling anyone. – Jack Johansson May 25 '17 at 19:22
  • 1
    @TheWPNovice You are welcome. I already did. – Jack Johansson May 25 '17 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.