ACF + WPML: How to translate date fields?

You can use the global $wp_locale to get the month translated in each language. You just need to get the month number (01 to 12) from the Acf field. You have the functions in the WP_Locale class get_month() and get_month_abbrev() global $wp_locale; $month = $wp_locale->get_month(04); // Output april in english $month_abbrev = $wp_locale->get_month_abbrev($month); // Output … Read more

Use specific language for comment section

On the bottom of comments.php I use the following code: <?php comment_form(array(‘comment_field’ => ‘<p class=”comment-form-comment”><label for=”comment”>Comment</label><textarea id=”comment” name=”comment” cols=”45″ rows=”8″ aria-required=”true”></textarea></p>’, ‘comment_notes_before’ => ‘<p class=”comment-notes”>Your email address will not be published. Required fields are marked *</p>’, ‘comment_notes_after’ => ”, ‘title_reply’ => ‘Leave a Reply’, ‘title_reply_to’ => ‘Leave a Reply to %s’, ‘label_submit’ => ‘Post comment’, … Read more

same comment list for two posts

You could use get_comments() instead. The code in this forum post gives an example of how you’d do that: <?php $recent_comments = get_comments( array(‘post_id’ => $newest_post_id,) ); foreach ($recent_comments as $comment) { ?> <?php $comment_id = get_comment($comment->comment_ID); $author = $comment_id->comment_author; $commentdate = $comment_id->comment_date; $content = $comment_id->comment_content; ?> <p><?php echo $author; echo $commentdate;?></p> <p><?php echo $content;?></p> … Read more

Translate placeholder text in search field

Just as any regular string, you can use <?php esc_attr_e( ‘Your Search term here’, ‘your_theme_slug’ ); ?> So your code for the <input> would look like <input type=”search” class=”search-field” placeholder=”<?php esc_attr_e( ‘Your Search term here’, ‘your_theme_slug’ ); ?>” value=”<?php echo esc_attr( $search ); ?>” name=”s”> WPML, as well as WordPress, uses the PHP get_text() function. … Read more

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