screenshot of shortcodes being rendered in post text

I’m trying to fix an issue with a custom WordPress theme that is rendering image captions inline on posts. My WP knowledge is spotty, so, I’m not quite sure where I should be looking.

Here’s the code that’s showing posts:

<?


$args = array (
    'post_type'              => array( 'post' ),
    'meta_key' => 'event_date', // name of custom field
    'orderby' => 'meta_value_num',
    'order' => 'ASC'
);

// The Query
$blogQuery = new WP_Query( $args );

  while ( $blogQuery->have_posts() ) {
      $blogQuery->the_post();
      $date = DateTime::createFromFormat('Ymd', get_field('event_date'));
      $today = DateTime::createFromFormat('Ymd', date('Ymd'));

      if($date > $today){

          echo '<div class="blog-entry">';
          echo '<h3 class="wonk green-nav">Event: ';
          echo get_the_title().'</h3>';

            if(get_field('update_type') == 'event'){

                echo '<h4>';    
                echo $date->format('l, F jS, Y. ');
                the_field('event_time');
                echo '</h4>';

            }


          echo '<p>' .get_the_content().'</p>';
          echo '</div>';
          }

      }

 wp_reset_postdata();

?>

Here’s a screenshot showing what’s on the front-end…

Read more here: WordPress image caption shortcodes showing on posts (not rendering as captions)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: