恐怕最终的答案将出现在您的服务器日志中。(您还可以在wp config中打开调试-有时也会有帮助)
但我确实注意到了一些可以帮助您跟踪问题的事情:
<?php
// You should not require the $orig_post variable...
global $post;
// Get the tag ids directly:
$tag_ids = wp_get_post_tags( $post->ID, array( \'fields\' => \'ids\' ) );
if (!empty($tag_ids)) {
$args=array(
\'tag__in\' => $tag_ids,
\'post__not_in\' => array($post->ID),
\'posts_per_page\'=>2, // Number of related posts to display.
\'caller_get_posts\'=>1
);
$my_query = new WP_Query( $args );
while( $my_query->have_posts() ) {
$my_query->the_post();
// **** What is the "set_featured_image_bg" function? Is it defined?
?>
<li class="full entry animate-box ll-article" style="background-image: url(\'<?php set_featured_image_bg(); ?>\');" data-animate-effect="fadeIn">
<div class="overlay"></div>
<div class="entry-desc">
<div class="border-police">
<a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a>
</div>
</div>
</li>
<? }
wp_reset_postdata(); // use this instead of "wp_reset_query", and right after you end your while loop...
}
?>
祝你好运!