Translate database content using __($message) function

If you want to have variables in your text to be translated the usual way would be with string formatting like so: <?php printf(__(“text %s text2.”), $message); ?> with integers: <?php printf(__(“text %d text2.”), $count); ?> with more then one placeholders: <?php printf(__(“text %1$s text2 %2$S.”), $message, $message2); ?> but the variable it self will … Read more

Fetch ID’s associated with a custom post type when translated with WPML?

NOTE: I’m not giving a full answer to your question but trying to give some snippets that may help in WPML-based project. I’ve used this function: function get_the_translated_ID($id){ if (!class_exists(‘sitepress’) return $id; global $sitepress; $type=get_post_type($id); return icl_object_id( $id, $type, false, $sitepress->get_default_language()); } This allows, for example, to search for custom_meta values of the original post … Read more

WPML in custom page templates

For the language filter from WPML to take effect you have to allow filters in get_posts. Default this is off. You can add suppress_filters=0 to your get_posts args and it should work. See: http://codex.wordpress.org/Template_Tags/get_posts#Parameters <ul id=”archive-list”> <?php $args = array( ‘suppress_filters’ => false, ‘numberposts’ => ‘-1’, ‘post_type’ => ‘post’, ); $myposts = get_posts($args); foreach($myposts as … Read more

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