'The Grid' only showing the same post in blog post

Good afternoon,

I have inserted ‘The Grid’ into a single post under the blog text to display other blog posts the user can click on.

I did this by setting up The Grid first (named ‘Related News’) and in preview mode works fine. I then put this into Pro – Child Theme: wp-single.php (framework/views/renew/wp-single.php):

<?php

// =============================================================================
// VIEWS/RENEW/WP-SINGLE.PHP
// -----------------------------------------------------------------------------
// Single post output for Renew.
// =============================================================================

$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );

get_header();

?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" role="main">

      <?php while ( have_posts() ) : the_post(); ?>
        <?php x_get_view( 'renew', 'content', get_post_format() ); ?>
        <?php x_get_view( 'global', '_comments-template' ); ?>
      <?php endwhile; ?>

		  <?php The_Grid('Related News', true); // where true is for template mode
?>
		
    </div>
  
    <?php if ( $fullwidth != 'on' ) : ?>
      <?php get_sidebar(); ?>
    <?php endif; ?>

  </div>

<?php get_footer(); ?>

The Grid does load but for some reason only displays the exact same post and nothing more.

What is odd is I have a duplicate of my grid on the homepage displaying 6 and it works fine. Guess it is getting confused in a single post? How can I fix this?

Thank you
Jason

Hello Jason,

Thanks for writing in!

You only use this line in the archive.php as what the documentation has suggested:

<?php The_Grid('Related News', true); // where true is for template mode
?>

You will need to use this line instead:

<?php echo do_shortcode('[the_grid name="Related News"]'); ?>

Please check your post again.

That is PERFECT thank you!

Kind Regards,
Jason

You’re welcome, Jason.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.