• Hello!
    i am currently trying to design a custom YARPP theme, based on the thumbnails file within the yarp plugin folder (pulled a copy to the theme)

    What’s bugging me is that i cannot remove the post title, which is stuck within the_post_thumbnail.

    If I add this code, the title, and then the image pop up.
    but i want the title to be rendered Below the image. Adding the_title works alright, but i also need to remove the initial title above it.

    Here’s what it looks like in the browser right now:

    And here’s my code

    <?php
    /*
    YARPP Template: CB-Thumbnails
    Description: This template returns the related posts as thumbnails in an ordered list. Requires a theme which supports post thumbnails.
    Author: YARPP Team
    */
    ?>
    */
    ?>
    
    <?php
    /* Pick Thumbnail */
    global $_wp_additional_image_sizes;
    if ( isset( $_wp_additional_image_sizes['et-pb-post-main-image'] ) ) {
    	$dimensions['size'] = 'et-pb-post-main-image';
    } else {
    	$dimensions['size'] = 'medium'; // default
    }
    ?>
    
    <h3>Related Posts</h3>
    <?php if ( have_posts() ) : ?>
    <div class="yarpp-thumbnails-horizontal">
    	<?php
    	while ( have_posts() ) :
    		the_post();
    		?>
    		<?php if ( has_post_thumbnail() ) : ?>
    		<a class="yarpp-thumbnail" 
    			href="<?php the_permalink(); ?>" 
    			rel="bookmark norewrite" 
    			title="<?php the_title_attribute(); ?>
    		">
    
    			<?php the_post_thumbnail( 
    				$dimensions['size'], 
    				array( 'data-pin-nopin' => 'true', 'title' => the_title_attribute() ) 
    			);
    			?>
    			<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    				
    			</a>
    		<?php endif; ?>
    	<?php endwhile; ?>
    </div>
    <?php else : ?>
    <p>No related Posts.</p>  
    <?php endif; ?>
    

    if i remove the thumbnail from the code, the first title also goes. It must come from within somehow.

    So my main question is how i can ensure not to render the title as the part of the thumbnail?

  • The topic ‘YARPP Thumbnail template contains title in post thumbnail??’ is closed to new replies.