Translate arguments of a user added custom code [closed]

Because you are hardcoding the link, you will need to use icl_link_to_element() function and wrap any text you want to translate inside a gettext function: <?php icl_link_to_element( ‘ID_of_your_news_page’, ‘page’, ‘<h4>’ . __(‘News’) . ‘</h4>’ ); ?> This way you will get the correct version of the link based on the current language with the text … Read more

Changing the header image using WPML

You can use site_url() or get_site_url(). Depending on your install and setup, you could as well use network_site_url() – which is what I would prefer as it falls back to site_url() internally if it is no multisite setup. The site_url( $path, $scheme ); function also takes two arguments: The $path can be used to append … Read more

wpml and languages with different directions

Could not found why the is_rtl() is not working properly, but found that wpml_is_rtl is doing it’s own job, so by adding this code to theme’s functions.php everything seems to work fine: if ( apply_filters( ‘wpml_is_rtl’, null) ) { mu_fix_is_rtl(true); }else { add_filter(‘language_attributes’,’mu_alter_language_attributes’); mu_fix_is_rtl(false); } function mu_alter_language_attributes($output, $doctype){ return str_replace(‘rtl’,’ltr’,$output); } function mu_fix_is_rtl($rtl){ global $wp_locale; … Read more

How to translate text in function.php with WPML [closed]

It should suffice to add a __() around your translatable text: add_action( ‘woocommerce_cart_calculate_fees’, ‘custom_handling_fee’, 10, 1 ); function custom_handling_fee ( $cart ) { if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) return; if ( ‘cod’ === WC()->session->get(‘chosen_payment_method’) ) { $fee = 10; $cart->add_fee( __(‘Cash On Delivery’), $fee, true ); } } You can then … Read more

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