不知道我做错了什么。我是一名初学者,但我已经尝试了很多东西:
我正在尝试打印来自图像的post\\u父级的内容。这是我现在正在使用的。我可以发布标题,但不能发布内容(在打印内容方面,我只能成功地打印图像的内容(实际上是图像的“描述”,而不是我想要的)。
<?php echo wp_get_attachment_image( $post->ID, \'post-image\' ); ?>
<h4 class="attach-title"><?php the_title(); ?></h4>
<p>
<a
href="<?php echo get_permalink( $post->post_parent ); ?>"
title="<?php esc_attr( printf( __( \'Return to %s\', APP_TD ), get_the_title( $post->post_parent ) ) ); ?>"
rel="gallery">
<?php
printf(
\'<span class="meta-nav">\' . __( \'← Return to %s\', APP_TD ) . \'</span>\',
get_the_title( $post->post_parent )
);
?>
</a>
</p>
<p>
<a
href="<?php echo get_permalink( $post->post_parent ); ?>"
the_content="<?php esc_attr( printf( __( \'Return to %s\', APP_TD ), get_the_content( $post->post_parent ) ) ); ?>"
rel="gallery">
<?php
printf(
\'<span class="meta-nav">\' . __( \'← Return to %s\', APP_TD ) . \'</span>\',
get_the_content( $post->post_parent )
);
?>
</a>
</p>
前两段代码工作正常,但最后一段是我想提取内容的地方。但这段代码只是打印图像本身的描述,而不是post\\u父对象的内容。