WordPress.org

Making WordPress.org

Changeset 3631


Ignore:
Timestamp:
07/07/2016 06:04:37 AM (3 years ago)
Author:
pento
Message:

Breathe: Simplify the welcome message.

The welcome message is now two columns. Instead of requiring hard coded HTML in the page, it now just requires a <hr> to split the columns, so the page can be safely editing in the visual editor.

Fixes #1803.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r3630 r3631  
    77
    88    // Cacheing hack
    9     wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160707' );
     9    wp_enqueue_style( 'wporg-breathe', get_stylesheet_uri(), array( 'p2-breathe' ), '20160707a' );
    1010}
    1111add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\styles', 11 );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/header.php

    r3630 r3631  
    2727$hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : '';
    2828
    29 if ( $welcome && md5( $welcome->post_content ) !== $hash ) {
     29$content_hash = $welcome ? md5( $welcome->post_content ) : '';
     30
     31if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) {
     32    $columns = preg_split( '|<hr\s*/?>|', $welcome->post_content );
     33    if ( count( $columns ) === 2 ) {
     34        $welcome->post_content = "<div class='first-column'>\n\n{$columns[0]}</div><div class='second-column'>\n\n{$columns[1]}</div>";
     35    }
    3036    setup_postdata( $welcome );
    3137?>
    3238<div class="make-welcome-wrapper">
    33     <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo md5( $welcome->post_content ); ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span>
     39    <span id="make-welcome-hide" class="dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php _e( 'Hide this message', 'p2-breathe' ); ?>"></span>
    3440    <div class="make-welcome">
    3541        <?php
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/style.css

    r3630 r3631  
    314314#make-welcome-hide {
    315315    float: right;
    316     margin: 30px;
     316    margin: 15px;
    317317    cursor: pointer;
    318318}
     
    349349}
    350350
     351.make-welcome .first-column {
     352    width: 71%;
     353    display: inline-block;
     354}
     355
     356.make-welcome .second-column {
     357    width: 25%;
     358    float: right;
     359}
     360
    351361.make-welcome .welcome {
    352362    padding-top: 1%;
     
    362372    text-align: right;
    363373    margin: 0 5px 5px 0;
     374    clear: both;
    364375}
    365376
     
    387398    }
    388399}
     400
     401@media screen and (max-width: 1000px) {
     402    .make-welcome .first-column,
     403    .make-welcome .second-column {
     404        width: 100%;
     405        float: none;
     406        clear: both;
     407    }
     408}
Note: See TracChangeset for help on using the changeset viewer.