这对我有用。注释掉post\\u优先级
<div class="leftdash">
<h2>My Post</h2>
<?php
$current_user = wp_get_current_user();
$args = array(
\'author\' => $current_user->ID,
\'orderby\' => \'post_date\',
\'order\' => \'ASC\',
\'post_status\' => \'publish\',
\'posts_per_page\' => -1
);
$current_user_posts = get_posts( $args );
//echo "<pre>"; print_r($current_user_posts); die;
foreach ($current_user_posts as $post) {
?>
<article id="post-<?php echo $post->ID; ?>" class="post-814 post type-post status-publish format-standard hentry category-uncategorized tag-priority-6">
<header class="page-header">
<h1 class="page-title"><a href="<?php echo $post->guid; ?>" rel="bookmark"><?php echo $post->post_title; ?></a></h1>
<div class="entry-meta">
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php $content = $post->post_content;
$trimmed_content = wp_trim_words( $content, 5, NULL );
echo $trimmed_content
?></p>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span>Priority <?php echo get_field( "post_priority", $post->ID ); ?></span>
<span class="cat-links">
Posted in <?php $category_detail=get_the_category($post->ID);//$post->ID
foreach($category_detail as $cd){
?>
<a href="<?php echo get_category_link($cd->cat_ID); ?> ">
<?php echo $cd->cat_name; ?> </a>
<?php
} ?>
</span>
<span class="tags-links">
Tagged <?php $postid = $post->ID;
$posttags = get_the_tags($postid);
if ($posttags) {
foreach($posttags as $tag) {
?>
<a href="<?php echo get_tag_link($tag->term_id); ?>" rel="tag"><?php echo $tag->name ; ?></a>
<?php } } ?>
</span>
<span class="comments-link"><a href="<?php echo get_comments_link( $post->ID ); ?>">Leave a comment</a></span>
<span class="edit-link"><a class="post-edit-link" href="<?php echo get_edit_post_link($post->ID); ?>">Edit</a></span>
</footer><!-- .entry-meta -->