I think you are having same issue as I was having earlier. In this question.
So here is the fixed code. This should work. I replaced both of these functions with get_the_date
and get_the_excerpt
. For the detailed explanation why/why not this work, read @kaiser’s answer in same question.
<?php
$args = array(
'posts_per_page' => 5,
'post_type' => 'my',
'order_by' => 'post_date',
'tax_query' => array(
array(
'taxonomy' => 'mycategory',
'field' => 'id',
'terms' => array(36, 38, 83, 84),
'operator' => 'NOT IN'
),
),
);
$last_five_posts = get_posts( $args );
foreach ( $last_five_posts as $post ) : setup_postdata( $post ); ?>
<div><a href="https://wordpress.stackexchange.com/questions/173053/<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" id="frontpagelatestposttitle"><?php the_title(); ?></a></div>
<div><?php echo get_the_date(); ?></div>
<div id="frontpagelatestpostexcerpt">
<p><?php echo get_the_excerpt(); ?></p>
</div>
<?php endforeach;
wp_reset_postdata();
?>