Making WordPress.org

Changeset 398


Ignore:
Timestamp:
02/14/2014 12:59:27 AM (10 years ago)
Author:
iandunn
Message:

Coming Soon Page: Add custom image size.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/TODO.txt

    r395 r398  
    1010    internationalize
    1111    any other TODOs in code
    12     customize image size in template
     12    select image size from dropdown of available sizes
     13        maybe add more custom sizes too
    1314    make the date lookup less fragile? maybe store blog id in wordcamp post type meta so don't have to rely on url, or just parse_url() to make matching easier
    1415   
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/classes/wordcamp-coming-soon-page.php

    r396 r398  
    1313        add_action( 'wp_head',            array( $this, 'render_dynamic_styles' ) );
    1414        add_filter( 'template_include',   array( $this, 'override_theme_template' ) );
     15
     16        add_image_size( 'wccsp_image_medium_rectangle', 500, 300 );
    1517    }
    1618
     
    136138     */
    137139    public function get_image_url() {
    138         $settings = $GLOBALS['WCCSP_Settings']->get_settings();
    139         $image    = wp_get_attachment_image_src( $settings['image_id'], 'full' );
     140        $settings   = $GLOBALS['WCCSP_Settings']->get_settings();
     141        $image_meta = wp_get_attachment_metadata( $settings['image_id'] );
     142        $size       = isset( $image_meta['sizes']['wccsp_image_medium_rectangle'] ) ? 'wccsp_image_medium_rectangle' : 'full';
     143        $image      = wp_get_attachment_image_src( $settings['image_id'], $size );
    140144       
    141145        return $image ? $image[0] : false;
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/css/template-coming-soon.css

    r397 r398  
    1616    #wccsp-image {
    1717        display: block;
     18        max-width: 100%;
    1819        margin: 0 auto 40px auto;
    1920    }
Note: See TracChangeset for help on using the changeset viewer.