Support » Plugin: Related Posts for WordPress » Display related posts at a different place

  • Resolved florianwilhelm

    (@florianwilhelm)


    Hi,

    I would like to use your plug-in to display related posts, that I use as Product pages.
    I don’t need eCommerce features, so creating posts and relating them to each others is the best solution I came with in terms of simplicity and overall performances.

    What I don’t find out is how I can change the place the related posts are displayed at.
    As you can see on this screenshot, they are currently displayed under my post text blocks (https://ibb.co/3Yf2GFs), but I have a widget beneath that I created through my page template:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php if ( ! twentynineteen_can_show_post_thumbnail() ) : ?>
    	<header class="entry-header">
    		<?php get_template_part( 'template-parts/header/entry', 'header' ); ?>
    	</header>
    	<?php endif; ?>
    
    	<div class="entry-content product-template">
    		<?php
    		the_content(
    			sprintf(
    				wp_kses(
    					/* translators: %s: Name of current post. Only visible to screen readers */
    					__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentynineteen' ),
    					array(
    						'span' => array(
    							'class' => array(),
    						),
    					)
    				),
    				get_the_title()
    			)
    		);
    
    		wp_link_pages(
    			array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'twentynineteen' ),
    				'after'  => '</div>',
    			)
    		);
    		
    		echo '<div class="alignfull block-fullwidth locator">';
    		
    		echo '<h2>';
    		pll_e('Find yours wherever you are.');
    		echo '</h2>';
    		
    		echo '<p>';
    		pll_e('Our products and services are available in 20 countries in Europe, Africa, Oceania and South America. Thanks to a network formed of trusted retailers, we are able to deliver the VinPilot® product range to you, wherever you are.');
    		echo '</p>';
    		
    		echo '<p class="bouton">';
    		echo '<a href="/#">';
    		pll_e('Find your VinPilot<sup>®</sup>');
    		echo '</a>';
    		echo '</p>';
    		echo '</div>';
    		
    		echo '<h2>';
    		pll_e('You might also be interested in these products');
    		echo '</h2>';
    		echo do_shortcode( '[related_post]' ); 
    		
    
    		?>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-${ID} -->

    I would like to put the related posts after this widget.
    Could you please indicate me which is the best solution to do so?

    Thank you very much
    Best regards
    Florian

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display related posts at a different place’ is closed to new replies.