WordPress Translation Issue

You are exploding the text with explode( ‘ ‘, $ctxttext ). Therefore you are translating word by word, not strings. That is why it’s working with single word string, and not with multiple words. When you call First Name you are translating First and Name. Cheers

Translation from .mo file not working in theme

Start a new theme from scratch to see if you have the same result. I test with theses files and the translation works style.css /* Theme Name: My Theme */ functions.php <?php add_action( ‘after_setup_theme’, ‘my_theme_load_theme_textdomain’ ); function my_theme_load_theme_textdomain() { load_theme_textdomain( ‘my-theme’, get_template_directory() . ‘/languages’ ); } languages/es_ES.po (file languages/es_ES.mo created with poedit) msgid “Featured” msgstr … Read more

Using _e() or __() to translate text with div

None of them are correct. These APIs are not intended for dynamic data or content in the database. This would be the best practice answer: echo ‘<h2 class=”title”>’; esc_html_e( ‘static string’, ‘text-domain’ ); echo ‘</h2>’; If you want to translate posts and other database user entered content, use a translation plugin, not the localisation API. … Read more

WordPress Theme .mo-file won’t load

load_theme_textdomain() needs an absolute path to the directory, so you should set your THEME_URL like so define(“THEME_URL”, get_template_directory()); define(“TRANSLATION_URL”, THEME_URL . “/languages”); It wasn’t working for you because get_bloginfo(“template_url”) is an URL and not an absolute path on your server.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)