我正在尝试创建一个部分,显示由创建当前帖子的用户创建的帖子。我需要向他们展示明显排除当前帖子并根据某种类型的帖子(事件)。
我有这个代码,但它不起作用。有人能想到如何帮助我吗?
<?php
$args = array(
'author' => $post->post_author;
'type' => $post_meta['_listing_type'][0] == 'event',
'order' => 'ASC',
'posts_per_page' => -1
);
$eventos = get_posts( $args );
foreach ( $eventos as $evento ) {
$output .= '<div>'.$evento.'</div>';
endforeach;
if(!empty($eventos)) : ?>
<div id="listing-eventosartista" class="listing-section">
<h3 class="listing-desc-headline margin-top-60 margin-bottom-30"><?php esc_html_e('Eventos del artista','listeo_core'); ?></h3>
<div class="single-item">
<?php echo $output; ?>
</div>
</div>
<?php endif ?>
慕勒3428872