0

I have these two issues:

1: WARNING: Your theme appears to be in the wrong directory for the theme name. The directory name must match the slug of the theme.

2: REQUIRED: The 

<title>

tags can only contain a call to wp_title(). Use the wp_title filter to modify the output

For #1

Based on what I searched, the text domain is the theme name both of the folder and in style.css. I have checked and they all are the same. Is it because I am using Wamp?

I have also tried inserting this to functions.php and to header.php but that resulted in the same error: load_theme_textdomain('themename', get_template_directory() . '/languages');

Wordpress did state this but it is unclear to me that text domain is solely for WordPress.org and not for externally and locally hosted domains or is universal:

Themes that are hosted on WordPress.org the text domain must match the slug of your theme URL (wordpress.org/themes/). This is needed so that the translations from translate.wordpress.org work correctly.

The text domain name must use dashes and not underscores and be lowercase. For example, if the theme’s name My Theme is defined in the style.css or it is contained in a folder called my-theme the text domain should be my-theme.

The text domain is used in three different places:

In the style.css theme header As an argument in the localization functions As an argument when loading the translations using load_theme_textdomain() or load_child_theme_textdomain() style.css theme header #style.css theme header The text domain is added to the style.css header so that the theme meta-data like the description can be translated even when the theme is not enabled. The text domain should be same as the one used when loading the text domain.

Source: https://developer.wordpress.org/themes/functionality/internationalization/#text-domain

For #2

I have removed the <title> and </title> tags, yet that the error is still shown.

Please help explain, thanks.

5
  • 1. If in your style.css file, you've got Theme Name: My Theme, then the theme folder should be my-theme (i.e. you'd have wp-content/themes/my-theme) - and also, the text domain should be my-theme as in Text Domain: my-theme. Does your theme follow these rules? 2. Is there a <title> tag in any PHP files in your theme?
    – Sally CJ
    Aug 10, 2019 at 5:39
  • Thanks for the reply, Sally CJ. To note, my theme name is a single name. Let's call it abc.||[1. If in your style.css file, you've got Theme Name: My Theme, then the theme folder should be my-theme (i.e. you'd have wp-content/themes/my-theme) - and also, the text domain should be my-theme as in Text Domain: my-theme. Does your theme follow these rules?]// style.css // Theme Name: abc; Text Domain: abc||// others //wp-content/themes/abc[2. Is there a <title> tag in any PHP files in your theme?]||None at all, I've double, triple, etc. checked.||Could they be false positives?
    – Veneripmi
    Aug 10, 2019 at 8:20
  • Maybe. And if you can share the theme (on GitHub, maybe?), I can help you check it.
    – Sally CJ
    Aug 10, 2019 at 8:49
  • Nice of you, thanks! Sorry for the late response, here you go: github.com/Veneripmi/StExchange
    – Veneripmi
    Aug 13, 2019 at 6:20
  • Well, the only issue I see in your theme is that you're using the wrong text domain (theme-slug) in theme_slug_widgets_init() - and the correct text domain is ayabil2..
    – Sally CJ
    Aug 13, 2019 at 11:45

1 Answer 1

1

So that's the cause. Thanks a lot, Saly CJ. The answer is by Sally CJ's

using the wrong text domain (theme-slug) in theme_slug_widgets_init() - and the correct text domain is ayabil2

(sorry Sally CJ, can't seem to add your reply as answer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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