• Resolved Hunterwolf

    (@hunterwolf88)


    hello there how can I change the “featured image” size?

    I found this in the punctions.php theme file:

    if ( ! function_exists( 'sparkling_setup' ) ) :
    /**
     * Sets up theme defaults and registers support for various WordPress features.
     *
     * Note that this function is hooked into the after_setup_theme hook, which
     * runs before the init hook. The init hook is too late for some features, such
     * as indicating support for post thumbnails.
     */
    function sparkling_setup() {
    
    	/*
    	 * Make theme available for translation.
    	 * Translations can be filed in the /languages/ directory.
    	 */
    	load_theme_textdomain( 'sparkling', get_template_directory() . '/languages' );
    
    	// Add default posts and comments RSS feed links to head.
    	add_theme_support( 'automatic-feed-links' );
    
    	/*
    	 * Enable support for Post Thumbnails on posts and pages.
    	 *
    	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    	 */
    	add_theme_support( 'post-thumbnails' );
    
      add_image_size( 'sparkling-featured', 750, 394, true );
    	add_image_size( 'tab-small', 60, 60 , true); // Small Thumbnail
    
    	// This theme uses wp_nav_menu() in one location.
    	register_nav_menus( array(
    		'primary' => __( 'Primary Menu', 'sparkling' ),
    		'footer-links' => __( 'Footer Links', 'sparkling' ) // secondary nav in footer
    	) );
    
    	// Enable support for Post Formats.
    	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
    
    	// Setup the WordPress core custom background feature.
    	add_theme_support( 'custom-background', apply_filters( 'sparkling_custom_background_args', array(
    		'default-color' => 'F2F2F2',
    		'default-image' => '',
    	) ) );
    
      // Enable support for HTML5 markup.
      add_theme_support( 'html5', array(
        'comment-list',
        'search-form',
        'comment-form',
        'gallery',
        'caption',
      ) );
    }
    endif; // sparkling_setup
    add_action( 'after_setup_theme', 'sparkling_setup' );

    so I copied and then modified it in my child theme “functions.php” file,
    then I modified:

    add_image_size( 'sparkling-featured', <strong>750, 394</strong>, true );

    I added all this code to my child functions because adding only “add_image_size( ‘sparkling-featured’, 750, 394, true );” doesn’t work.

    so can you suggest a better way to reduce the featured image size without the superfluous parts? just to understand for the next time 🙂

    sorry but I’m really new in this!

    Thank you in advance

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘change featured image size’ is closed to new replies.