는 : 내가이기 때문에WP_Query 및 태그 ID
<?php
$the_query = new WP_Query(array (
'posts_per_page' => '-1',
'tag_id' => ''
));
while ($the_query->have_posts()) : $the_query->the_post();
?>
당신이 볼 수 있듯이, "tag_id"값이 비어 작동하므로이 에코가 값을 반환
<?php echo of_get_option('slideshow-tags', 'no entry'); ?>
하지만 PHP는 오류를받지 않고 쿼리에이 적응하는 방법을 모른다 : 여기에서 값을 검색하려고합니다.
내가 시도 :<?php
$the_query = new WP_Query(array (
'posts_per_page' => '-1',
'tag_id' => 'echo of_get_option('slideshow-tags', 'no entry'); '
));
while ($the_query->have_posts()) : $the_query->the_post();
?>
그러나 그것은 작동하지 않습니다. 나는 뭔가 명확한 것을 놓치고 있다면 나에게 맨손으로 PHP를 잘 아는 사람이 아니다.
고마워요!
요한은
는 편집 : 여기
나중에 참조 할 수 있도록 대답이를 사용하는
<?php
$the_query = new WP_Query(array (
'posts_per_page' => '-1',
'tag_id' => of_get_option('slideshow-tags', 'no entry')
));
while ($the_query->have_posts()) : $the_query->the_post();
?>
Joseph Silber에게 감사드립니다. 나는 당신의 코드를 시도하고 매력처럼 일했다 :) – Johann