Localising a Block

There are 2 main issues in your code: As stated in my answer, the script handle format is <block name with slashes replaced with hypens>-editor-script, so because your block name is my-block/local, then the script handle is my-block-local-editor-script and not my-block-local-edit-script. The correct action name is wp_enqueue_scripts (note the “s”) and not wp_enqueue_script. However, wp_enqueue_scripts … Read more

How to change text depending on the country

There are several plugins out there that help you to translate your site content. Though you could have googled that by yourself easily, look here to get a brief overview: https://premium.wpmudev.org/blog/top-6-translation-plugins-for-your-wordpress-site/ WPML is a very powerful translation plugin (not free), in your case qTranslate should be good enough and is easier to implement than WPML … Read more

Loading Canvas & WooCommerce translation file in child theme

There was a syntax error in loading the WooCommerce translations and I managed to get the parent theme translations working by following the same method I used for the WooCommerce translations. function weg_localisation() { unload_textdomain( ‘woothemes’ ); load_textdomain(‘woothemes’, get_stylesheet_directory() . ‘/lang/af_AF.mo’); unload_textdomain(‘woocommerce’); load_textdomain(‘woocommerce’, get_stylesheet_directory() . ‘/woocommerce/i18n/languages/woocommerce-af_AF.mo’); } add_action(‘init’, ‘weg_localisation’);

How to use esc_attr__() function properly to translate a variable that contains string?

If you have static text with dynamic content then you can use. printf( esc_attr___(‘static text goes here with %s’, ‘text-domain’ ), $title ); If you have only $title then no need to translate it. Just escape it. echo esc_attr( $title ); Note esc_attr, esc_attr__ and esc_attr_e used for escaping dynamic values from HTML element attributes. … Read more

Tool bar in editor missing in WP

I’m guessing you mean the WordPress Admin bar which shows in the header of the logged in user page? Can you get the user to login and check that they haven’t disabled this under the User > My Profile menu option Also you might like to check out this plugin which allows you to switch … Read more

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