Skip to:
Content
Pages
Categories
Search
Top
Bottom

custom size for featured image

Viewing 3 replies - 1 through 3 (of 3 total)
  • @robin-w

    Moderator

    which particular code did you use, please post the snippet here

    @andrew55

    Participant

    Sure, this is the code I’m using:

    add_post_type_support('topic', array('thumbnail'));
    add_post_type_support('forum', array('thumbnail'));
    /*
    Plugin Name: bbPress - Forum Icons
    Plugin URI: https://gist.github.com/ntwb/8277457
    Description: bbPress - bbPress - Forum Icons
    Version: 0.1
    Author: Stephen Edgar - Netweb
    Author URI: http://netweb.com.au
    */
    // Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/
    add_post_type_support('forum', array('thumbnail'));
    function ks_forum_icons() {
    	if ( 'topic' == get_post_type() ) {
    		global $post;
    	    if ( has_post_thumbnail($post->ID) )
    	    	echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
    	 }
    }
    add_action('bbp_theme_before_topic_title','ks_forum_icons');

    @robin-w

    Moderator

    without further digging, the function

    echo get_the_post_thumbnail

    seems to support

    thumbnail
    medium
    large
    full

    so you can have for instance

    echo get_the_post_thumbnail($post->ID,'medium',array('class' => 'alignleft forum-icon'));
    echo get_the_post_thumbnail($post->ID,'large',array('class' => 'alignleft forum-icon'));

    you can also play with these settings – see

    https://www.elegantthemes.com/blog/tips-tricks/how-to-change-thumbnail-size-in-wordpress-and-why-you-want-to

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar