0
현재 게시물/페이지와 동일한 태그를 사용하여 관련 게시물을 쿼리하려고하지만 이미 격자를 생성하는 데 사용중인 코드 형식 내에서 작동해야했습니다. 내가 좋아하는 그것을 통합하려고 할 때 유망한 보였지만, Wordpress Querying Related Posts by tagWordpress 검색어 관련 게시물
..
<?php
$c = 1; //init counter
$bpr = 3; //boxes per row
$test = "";
$posttags = get_the_tags();
$test = '';
$sep = '';
if ($posttags) {
foreach($posttags as $tag) {
$test .= $sep . $tag->name;
$sep = ",";
}
}
query_posts('tag=' .$test . '&showposts=-1'); if(have_posts()) : while (have_posts()) : the_post(); ?>
는 불행히도 생성 아무것도 :
<?php
$c = 1; //init counter
$bpr = 3; //boxes per row
if(have_posts()) : while (have_posts()) : the_post(); ?>
<div class="postgrid" id="post-<?php the_ID(); ?>">
<div class="postthumb">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('grid-post-image'); ?></a><div class="borderthumb"></div><div class="posttitle"><h1><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">Click for more</a></p></div>
</div>
</div>
<?php
if($c == $bpr) :
?>
<?php
$c = 0;
endif;
?>
<?php
$c++;
endwhile;
endif;
?>
나는이 결과가 없습니다. 어떤 도움?
감사합니다. 나는 두 스크립트가 상충되고 있으며 나는 PHP가 없다고 생각한다. spec for query_posts
에서
코드가 동적으로 페이지에 첨부 된 태그를 찾아 보여주기위한 방법이 있습니까? 따라서 테스트 페이지에 태그를 지정하면 테스트가 검색됩니다. 하지만 'test2'태그를 추가하면 test2가 발견됩니까? 이것이 내가 어쨌든하고 싶은 것 인 것처럼 궁금해하는 것입니다! – Amy