我有这段代码并且工作正常:
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'colors', true);
我想删除字符,
并插入<br />
如下代码:
echo str_replace(",", "<br />", get_post_meta($postid, 'colors', true));
但是,我怎样才能把这两个代码都正确地放在 PHP 中呢?
如果我放这个,它将不起作用:
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'colors', true);
echo str_replace(",", "<br />", get_post_meta($postid, 'colors', true));