Making WordPress.org


Ignore:
Timestamp:
06/28/2016 09:57:35 PM (10 years ago)
Author:
iandunn
Message:

WordCamp Post Types: Add custom image size for sponsor logos.

This prevents them from being cropped in undesirable ways.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r3361 r3602  
    1919                add_action( 'init', array( $this, 'register_taxonomies' ) );
    2020                add_action( 'init', array( $this, 'init' ) );
     21                add_action( 'after_theme_setup', array( $this, 'add_image_sizes' ) );
    2122
    2223                add_action( 'admin_init', array( $this, 'admin_init' ) );
    … …  
    8081
    8182                add_action( "admin_print_scripts-$page", array( $this, 'enqueue_order_sponsor_levels_scripts' ) );
     83        }
     84
     85        /**
     86         * Add custom image sizes
     87         */
     88        function add_image_sizes() {
     89                add_image_size( 'wcb-sponsor-logo-horizontal-2x', 600, 220, false );
    8290        }
    8391
    … …  
    10981106                                        <div class="wcorg-sponsor-description">
    10991107                                                <?php if ( 'website' == $attr['link'] && $website ) : ?>
    1100                                                         <a href="<?php echo esc_attr( esc_url( $website ) ); ?>"><?php the_post_thumbnail(); ?></a>
     1108                                                        <a href="<?php echo esc_attr( esc_url( $website ) ); ?>">
     1109                                                                <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x' ); ?>
     1110                                                        </a>
    11011111                                                <?php else : ?>
    1102                                                         <?php the_post_thumbnail(); ?>
     1112                                                        <?php the_post_thumbnail( 'wcb-sponsor-logo-horizontal-2x' ); ?>
    11031113                                                <?php endif; ?>
    11041114
Note: See TracChangeset for help on using the changeset viewer.