Home Forums WoodMart support forum Related posts and featured image

Related posts and featured image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #53930

    Stanley Black
    Participant

    Hello,

    1.How to display related posts? They are enabled in theme settings but not show up.

    2.How to remove featured image on post page? but I want to display that featured image in related posts and in theme blog element.

    Kind regards

    #53991

    Hello,

    In order to display related posts, you need to create tags http://prntscr.com/j8yi8k and then put this tags into the posts. The posts having equal tags will be displayed as Related posts.

    In order to hide the thumbnail image add this CSS code into Theme Settings > Custom CSS

    .post-single-page.has-post-thumbnail .entry-header {
        display: none;
    }

    Best Regards

    #54141

    Stanley Black
    Participant

    Thanks!

    #54154

    Stanley Black
    Participant

    Hello,

    Where I can set related posts number?
    Now is showing two related posts in carousel.

    I want to display 4 related posts.

    Best regards

    #54162

    Hello,

    Related posts are presented as a slider and when you hover you will see navigations arrows and all the posts which contain the tag would be presented

    Best Regards

    #54164

    Stanley Black
    Participant

    Thanks for your response.

    I now that, I want 4 related posts to show up in slider initially.
    There is 8 related posts, now they show up two by two(four bullets for navigation).
    I want to display them four by four.

    Best regards

    #54215

    Artem Temos
    Keymaster

    You can try to override our single.php file in the child theme with the following code

    <?php
    	get_header(); 
    	$content_class = woodmart_get_content_class();
    ?>
    <div class="site-content <?php echo esc_attr( $content_class ); ?>" role="main">
    		<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', get_post_format() ); ?>
    				<div class="woodmart-single-footer">
    					<?php if( get_the_tag_list( '', ', ' ) ): ?>
    						<div class="single-meta-tags">
    							<span class="tags-title"><?php esc_html_e('Tags', 'woodmart'); ?>:</span>
    							<div class="tags-list">
    								<?php echo get_the_tag_list( '', ', ' ); ?>
    							</div>
    						</div>
    					<?php endif; ?>
    					<?php if ( woodmart_get_opt( 'blog_share' ) && woodmart_is_social_link_enable( 'share' ) ): ?>
    						<div class="single-post-social">
    							<?php if( function_exists( 'woodmart_shortcode_social' ) ) echo woodmart_shortcode_social(array('type' => 'share', 'tooltip' => 'yes', 'style' => 'colored')) ?>
    						</div>
    					<?php endif ?>
    				</div>
    				<?php if ( woodmart_get_opt( 'blog_navigation' ) ) woodmart_posts_navigation(); ?>
    				<?php
    					if ( woodmart_get_opt( 'blog_related_posts' ) ) {
    					    $args = woodmart_get_related_posts_args( $post->ID );
    
    					    $query = new WP_Query( $args );
    
    						 if( function_exists( 'woodmart_generate_posts_slider' ) ) echo woodmart_generate_posts_slider(array(
    							'title' => esc_html__('Related Posts', 'woodmart'),
    							'el_class' => 'related-posts-slider',
    							'slides_per_view' => 4
    						), $query);
    					}
    				?>
    				<?php comments_template(); ?>
    		<?php endwhile; ?>
    </div><!-- .site-content -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    #54251

    Stanley Black
    Participant

    It’s works, thanks!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Related posts and featured image’ is closed to new replies.