Making WordPress.org


Ignore:
Timestamp:
07/12/2016 05:50:17 PM (10 years ago)
Author:
obenland
Message:

Breathe: Abstract and re-use existing styles.

See #1836.

File:
1 edited

Legend:

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

    r3671 r3672  
    11<?php
     2$welcome = get_page_by_path( 'welcome' );
     3$cookie  = 'welcome-' . get_current_blog_id();
     4$hash    = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : '';
     5$content_hash = $welcome ? md5( $welcome->post_content ) : '';
    26
    37$GLOBALS['pagetitle'] = get_bloginfo( 'name', 'display' );
    … …  
    2125
    2226<?php
    23 $welcome = get_page_by_path( 'welcome' );
    2427
    25 $cookie = 'welcome-' . get_current_blog_id();
    26 
    27 $hash = isset( $_COOKIE[ $cookie ] ) ? $_COOKIE[ $cookie ] : '';
    28 
    29 $content_hash = $welcome ? md5( $welcome->post_content ) : '';
    30 
    31 if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) {
     28if ( $welcome && ( empty( $hash ) || $content_hash !== $hash ) ) :
    3229        $columns = preg_split( '|<hr\s*/?>|', $welcome->post_content );
    3330        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>";
     31                $welcome->post_content = "<div class='content-area'>\n\n{$columns[0]}</div><div class='widget-area'>\n\n{$columns[1]}</div>";
    3532        }
    3633        setup_postdata( $welcome );
    3734?>
    38 <div class="make-welcome-wrapper">
    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>
    40         <?php
    41         edit_post_link( __( 'Edit', 'o2' ), '<p class="make-welcome-edit">', '</p>', $welcome->ID );
    42         ?>
    43         <div class="make-welcome">
    44                 <?php
    45                 the_content();
    46                 ?>
     35<div class="make-welcome">
     36        <div class="entry-meta">
     37                <?php edit_post_link( __( 'Edit', 'o2' ) ); ?>
     38                <button type="button" id="make-welcome-hide" class="toggle dashicons dashicons-no" data-hash="<?php echo $content_hash; ?>" data-cookie="<?php echo $cookie; ?>" title="<?php esc_attr_e( 'Hide this message', 'p2-breathe' ); ?>"></button>
     39        </div>
     40        <div class="entry-content clear">
     41                <?php the_content(); ?>
    4742        </div>
    4843</div>
    4944<?php
    5045        wp_reset_postdata();
    51 }
     46endif;
    5247?>
    5348
Note: See TracChangeset for help on using the changeset viewer.