我在第130行的“尝试获取非对象的属性”的快捷码中出错
以下是代码:
while ( $our_work->have_posts() ) { $our_work->the_post();
$termsArray = get_the_terms( $post->ID, "filter" ); //This is the line I\'m getting error. which is line no 130.
$termsString = ""; //initialize the string that will contain the terms
foreach ( $termsArray as $term ) { // for each term
$termsString .= $term->slug.\' \'; //create a string that has all the slugs
}
........(content is here)
}
wp_reset_postdata();
过滤器是自定义分类法。我正在使用同位素jquery插件,该插件在页面中运行良好,但在短代码中出现了这个错误。我不知道为什么这是给错误。请帮忙。谢谢