• Resolved Appaloosa

    (@benoitappaloosa)


    Hi,
    Download Monitor offers the option to add a featured image with is own function: <?php $dlm_download->the_image(); ?>

    But can-we choose the thumbnail size like in the the_post_thumbnail function?
    How put the thumbnail size to `medium’ WordPress default image size for example?
    What are the arguments for choose a WordPress image size ?
    Thank for your answer.

    • This topic was modified 4 years, 11 months ago by Appaloosa.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Thanks for reaching out to us.

    We use the default WordPress featured image for this. You can use “the_post_thumbnail” but we have not tested this so you will need to try it out. Please note any customization is beyond the scope of our support.

    Thread Starter Appaloosa

    (@benoitappaloosa)

    Hello Harish,

    Thank for your anwser.
    Of course, “the_post_thumbnail” don’t work directly in my custom template.
    In “src/download/Download.php”, I see that you use this function (“get_image”) to retrieve the thumbnail :

    	/**
    	 * Get download image
    	 *
    	 * @param string $size
    	 *
    	 * @return string
    	 */
    	public function get_image( $size = 'full' ) {
    		if ( has_post_thumbnail( $this->id ) ) {
    			return get_the_post_thumbnail( $this->id, $size );
    		} else {
    			return '<img alt="Placeholder" class="wp-post-image" src="' . apply_filters( 'dlm_placeholder_image_src', download_monitor()->get_plugin_url() . '/assets/images/placeholder.png', $this->id, $this ) . '" />';
    		}
    	}

    How, I can retrieve the “$this” variable. Or How I can get the post id in custom template for Download Monitor plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom size featured image in custom template?’ is closed to new replies.