나는이 문제를 잠시 동안 수색했다. 아마 간단 할 수도 있고 그렇지 않을 수도있다. 나는 이것을 어떻게 작동시키는지를 알 수 없었다.
나의 목표 결과는 포스트 스타일 메타와 관련된 하이퍼 링크가 될 것입니다.
<a href="href_link" style="color: #e67300" rel="nofollow"> Check out the r_title here!</a>
내가 가진 코드는 다음과 같습니다
<?php
$rtitle1 = get_post_meta($post->ID, 'r_title', true);
$rlink1 = get_post_meta($post->ID, 'href_link', true);
function testfunction() {
$output .= '<a href=\"'$rlink1'\" style=\"color: #e67300\" rel=\"nofollow\">';
$output .= ' Check out the '$rtitle1' here!</a>';
return $output;
}
add_shortcode('shortcode', 'testfunction');
?>
작은 따옴표 안의 큰 따옴표를 벗어나지 않아도됩니다. –