Localization of WP theme

Wrap the elements of $search and $replace arrays into __() function to get the translated strings: function search_replace_search() { $search_term = esc_attr( apply_filters( ‘the_search_query’, get_search_query( false ) ) ); // Get search term $search = array( __(‘word1’), __(‘word2’) ); $replace = array( __(‘something 1’), __(‘something 2’) ); $replacePairs = array_combine($search, $replace); echo strtr($search_term, $replacePairs); } … Read more

redirect to a child theme based on the town of Internet users in france with the verification of the ip address

A parent and a child theme haven’t been designed to do this. In your case you need to create template file for your tags (cities) i.e: single-paris.php, and load it with template_redirect filter, according to the request. Another way to achieve it, is to add a body class that will call another css values, but … Read more

How to translate functions.php?

Added to the functions.php the next: $pather = get_stylesheet_directory().’/languages’; load_child_theme_textdomain( ‘Savia-child’, $pather ); And then called it as: __( ‘text to translate’, ‘Savia-child’); In the child theme I have created a dir: /languages and put there po and mo files with the names: [locale].po/.mp like: ru_RU.po and ru_RU.mo. That is.

/languages/ folder missing in default themes

Themes and plugins on wordpress.org don’t need a /language folder anymore. The translation is made via Glotpress on https://translate.wordpress.org/. Glotpress parses the files and you can start to translate. The translated .mo and .po files get automatic updates, if a translation string changes. They are stored in /wp-content/languages If you don’t host your Theme or … Read more

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