menu customization

I’m not sure, but if I understand correctly you should create a second menu which is only visible on your Spanish language page. if (is_page($english_page_id)) { wp_nav_menu( array(‘menu’=>$english_menu) ); } if (is_page($spanish_page_id)) { wp_nav_menu( array(‘menu’=>$spanish_menu) ) } is_page() wp_nav_menu()

Dealing with variables with gettext function

You could just rename the labels associated with that post type. class News_Post_Type { const POST_TYPE = ‘post’; public static function init() { $post_obj = get_post_type_object(‘post’); $post_obj->labels->name = __(‘News Post’, ‘textdomain’); $post_obj->labels->singular_name = __(‘News Post’, ‘textdomain’); // You can continue to rename all the label properties, this is just an example } } add_action( ‘init’, … Read more

Archive widget numbers translation?

For archives you can use the get_archives_link filter like this: add_filter(‘get_archives_link’, ‘translate_archive_month’); function translate_archive_month($list) { $patterns = array( ‘/January/’, ‘/February/’, ‘/March/’, ‘/April/’, ‘/May/’, ‘/June/’, ‘/July/’, ‘/August/’, ‘/September/’, ‘/October/’, ‘/November/’, ‘/December/’ ); $replacements = array( //Put here whatever you want ’01’, ’02’, ’03’, ’04’, ’05’, ’06’, ’07’, ’08’, ’09’, ’10’, ’11’, ’12’ ); $list = preg_replace($patterns, … Read more

How to translate placeholder?

In your code, you are concatenating a string but you are (from a comment) using a function that echos information– _e(). You can’t do that. You are printing the content wherever that array is constructed, which is not what you want. Use __() instead.

Renaming/translating “your profile” page

This is more of PHP implementation detail. If you want a precise match you can do something like: if ( isset( $words[$translated] ) ) return $words[$translated]; return $translated; PS you might want to declare $words as static, so that array is reused and not continuously re-created on each function call (which would be a lot … Read more

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