Making WordPress.org


Ignore:
Timestamp:
02/23/2016 04:12:32 AM (10 years ago)
Author:
dd32
Message:

Plugins Directory: Implement basic Banner & Icon support (including porting the autotomatically generated icons plugin over) to give plugins a bit of individuality.
See #1584

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/single-plugin.php

    r2502 r2555  
    1 <?php the_post(); ?>
    2 <?php get_header(); ?>
     1<?php
     2the_post();
     3get_header();
     4$plugin_banners = WPorg_Plugin_Directory_Template::get_plugin_banner( $post );
     5
     6?>
    37
    48<div class="wrapper">
     
    610    <div style="width: 772px; margin: 0 auto;" itemscope itemtype="http://schema.org/SoftwareApplication">
    711
    8         <div id="plugin-head" class="plugin-head-with-banner">
     12        <div id="plugin-head" class="<?php echo $plugin_banners ? 'plugin-head-with-banner' : 'plugin-head-without-banner'; ?>">
    913
     14        <?php if ( $plugin_banners ): ?>
    1015            <div id="plugin-title" class="with-banner">
    1116                <div class="vignette"></div>
    1217                <style type="text/css">
    13                 #plugin-title { width:772px; height:250px; background-size:772px 250px; background-image: url(//ps.w.org/debug-bar/assets/banner-772x250.png?rev=478338); }
     18                    #plugin-title { width:772px; height:250px; background-size:772px 250px; background-image: url('<?php echo esc_url( $plugin_banners['banner'] ); ?>'); }
     19                    <?php if ( ! empty( $plugin_banners['banner_2x'] ) ): ?>
     20                    @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 15/10), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
     21                        #plugin-title { background-image: url('<?php echo esc_url( $plugin_banners['banner_2x'] ); ?>'); }
     22                    }
     23                    <?php endif; ?>
    1424                </style>
    1525
    1626                <h2 itemprop="name"><?php the_title(); ?></h2>
    1727            </div>
     28        <?php else: ?>
     29            <div id="plugin-title"><h2 itemprop="name"><?php the_title(); ?></h2></div>
     30        <?php endif; ?>
    1831
    1932            <div id="plugin-description">
Note: See TracChangeset for help on using the changeset viewer.