我的author.php
页我正在尝试获取帖子id,以便我可以回显评论所属帖子的永久链接。还可以回显一些post meta自定义字段。
这就是我的循环现在的样子-
<?php
$object = get_queried_object();
$authorID = get_queried_object()->ID;
$author_email = get_the_author_meta( \'user_email\', $authorID );
$postid = get_queried_object()->post->ID;
$args = array(
\'user_id\' => $authorID,
\'post_id\' => $postid,
);
// The Query
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query( $args );
// Comment Loop
if ( $comments ) {
foreach ( $comments as $comment ) { ?>
我试着在这里面放置一个普通的post循环,但事情变得很奇怪。我需要post meta的部分是--<div class="full-divs">
<strong>
<a href="<?php echo get_permalink(); ?>">
View
<?php
$property_address = get_post_meta(
get_the_ID(),
\'imic_property_site_address\',
true
);
echo $property_address;
?>
</a>
</strong>
</div>
我做错了什么?