Wordpress 类别:试图获得 属性 的非对象
Wordpress Categories: Trying to get property of non-object
我是 Wordpress 新手。我收到此错误:
注意:试图在第 486 行 /mnt/stor10-wc1-ord1/825767/iucn.oceanic.net.fj/web/content/wp-content/plugins/super-socializer/super_socializer.php 中获取非对象的 属性
这是由我使用的插件引起的 "Super Socializer"。它适用于其他页面,但我创建了一个自定义 post 类型并有 3 个类别。 link 将其带到类别模板。例如:link a 显示类别 A 的 posts,link B 显示类别 B 的 posts 等,
我的类别临时代码是这样的:
<?php
$args = array(
'posts_per_page' => 10,
'post_status' => 'publish',
'post_type' => 'oursuppliers',
'cat' => 35
);
query_posts($args);
?>
<?php
if ( have_posts() ): while ( have_posts() ) : the_post();
$post_title = get_the_title();
$post_author = $post->post_author;
$post_date = $post->post_date;
$link = get_field("resource-uploader");
$post_thumbnail_id = get_post_thumbnail_id( $id );
$thumbnail = wp_get_attachment_image_src( $post_thumbnail_id, "thumbnail");
$thumbnail = $thumbnail[0];
if( empty($thumbnail) ){
$thumbnail = get_template_directory_uri() . "/resources/images/default-150x150.jpg";
}
?>
<div >
<ul style="list-style: none; ">
<li style="display: inline; margin: 3%; height: 350px; " class="col-md-3">
<div>
<h5 style="font-weight: bold; color: #003399"><?php the_title() ?></h5>
</div>
<div>
<a href="<?php the_permalink(); ?>"> <img style="width: 150px; height: 150px; align-content: center;" src="<?php echo get_field("supplier_logo") ?>"/></a>
</div>
</li>
</ul>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
谁能指导我如何消除该错误。无论如何,我不需要此模板上的共享插件...
提前谢谢你:)
大多数时候,Wordpress 的通知是您根本不必担心的,尽管通知插件的开发人员以便他们可以在未来的版本中修复它是个好主意。
如果您的站点运行正常并且您正在管理一个高效站点,最好的方法应该是关闭调试消息。
在您的 wp-config.php
文件中,将 WP_DEBUG 设置为 false:
定义('WP_DEBUG', 假);
我是 Wordpress 新手。我收到此错误:
注意:试图在第 486 行 /mnt/stor10-wc1-ord1/825767/iucn.oceanic.net.fj/web/content/wp-content/plugins/super-socializer/super_socializer.php 中获取非对象的 属性
这是由我使用的插件引起的 "Super Socializer"。它适用于其他页面,但我创建了一个自定义 post 类型并有 3 个类别。 link 将其带到类别模板。例如:link a 显示类别 A 的 posts,link B 显示类别 B 的 posts 等,
我的类别临时代码是这样的:
<?php
$args = array(
'posts_per_page' => 10,
'post_status' => 'publish',
'post_type' => 'oursuppliers',
'cat' => 35
);
query_posts($args);
?>
<?php
if ( have_posts() ): while ( have_posts() ) : the_post();
$post_title = get_the_title();
$post_author = $post->post_author;
$post_date = $post->post_date;
$link = get_field("resource-uploader");
$post_thumbnail_id = get_post_thumbnail_id( $id );
$thumbnail = wp_get_attachment_image_src( $post_thumbnail_id, "thumbnail");
$thumbnail = $thumbnail[0];
if( empty($thumbnail) ){
$thumbnail = get_template_directory_uri() . "/resources/images/default-150x150.jpg";
}
?>
<div >
<ul style="list-style: none; ">
<li style="display: inline; margin: 3%; height: 350px; " class="col-md-3">
<div>
<h5 style="font-weight: bold; color: #003399"><?php the_title() ?></h5>
</div>
<div>
<a href="<?php the_permalink(); ?>"> <img style="width: 150px; height: 150px; align-content: center;" src="<?php echo get_field("supplier_logo") ?>"/></a>
</div>
</li>
</ul>
</div>
<?php endwhile; endif; wp_reset_query(); ?>
</div>
谁能指导我如何消除该错误。无论如何,我不需要此模板上的共享插件...
提前谢谢你:)
大多数时候,Wordpress 的通知是您根本不必担心的,尽管通知插件的开发人员以便他们可以在未来的版本中修复它是个好主意。
如果您的站点运行正常并且您正在管理一个高效站点,最好的方法应该是关闭调试消息。
在您的 wp-config.php
文件中,将 WP_DEBUG 设置为 false:
定义('WP_DEBUG', 假);