0
您好,我想使我的短代码中可翻译的部分输出,但我不知道该怎么做。 我试了好几次,但即使我设法添加代码,它显示的输出变量,以便将无法工作的div外面..短语可翻译输出
我不用翻译串代码是:
add_shortcode('cv', 'vp_cv');
function vp_cv($atts, $content=null) {
extract(shortcode_atts(array(
'number' => 6
), $atts));
global $post;
$output .= '<div class="container">';
$query = new WP_Query('post_type=resume&posts_per_page=' . $number . '&cat=' . $categories);
while($query->have_posts()) : $query->the_post();
$year = get_post_meta($post->ID, 'resume_year', true);
$title = get_the_title();
$client = get_post_meta($post->ID, 'resume_client', true);
$address = get_post_meta($post->ID, 'resume_address', true);
$output .= '<p class="year">' . $year . '</p>';
$output .= '<p class="cv-title">' . $title . '</p>';
$output .= '<p class="cv-client"> <strong> Client:</strong> ' . $client . '</p>';
$output .= '<p class="cv-address"> <strong> Address:</strong> ' . $address. '</p>';
endwhile;
$output .= '</div>
<div class="clearboth"></div>';
return $output;
}
我想添加到客户端和地址可以翻译的字符串,如: <?php _e('Client:','ikos');?>
它必须导致标签内
谢谢!
非常感谢!所以回声是不允许的或嘿。但它适用于第一个,谢谢youuuu –
:)不客气@CynthiaLara – iEmanuele
会给你“有用的答案”,但没有足够的声誉嘿 –