Making WordPress.org

Changeset 948


Ignore:
Timestamp:
10/29/2014 12:44:51 AM (12 years ago)
Author:
coffee2code
Message:

Code Reference: widgetize primary landing page footer

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

Legend:

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

    r941 r948  
    6161add_action( 'init', __NAMESPACE__ . '\\init' );
    6262add_filter( 'handbook_post_types', __NAMESPACE__ . '\\filter_handbook_post_types' );
     63add_action( 'widgets_init', __NAMESPACE__ . '\\widgets_init' );
    6364
    6465function init() {
     
    6970        add_action( 'after_switch_theme', __NAMESPACE__ . '\\add_roles' );
    7071        add_filter( 'user_has_cap', __NAMESPACE__ . '\\adjust_handbook_editor_caps', 11 );
    71         add_action( 'widgets_init', __NAMESPACE__ . '\\widgets_init' );
    7272        add_action( 'pre_get_posts', __NAMESPACE__ . '\\pre_get_posts' );
    7373        add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' );
     
    201201                'before_title'  => '<h1 class="widget-title">',
    202202                'after_title'   => '</h1><div class="widget-content">',
     203        ) );
     204
     205        register_sidebar( array(
     206                'name'          => __( 'Landing Page Footer - Left', 'wporg' ),
     207                'id'            => 'landing-footer-1',
     208                'description'   => __( 'Appears in footer of the primary landing page', 'wporg' ),
     209                'before_widget' => '<div id="%1$s" class="widget box %2$s">',
     210                'after_widget'  => '</div>',
     211                'before_title'  => '<h4 class="widget-title">',
     212                'after_title'   => '</h4>',
     213        ) );
     214
     215        register_sidebar( array(
     216                'name'          => __( 'Landing Page Footer - Center', 'wporg' ),
     217                'id'            => 'landing-footer-2',
     218                'description'   => __( 'Appears in footer of the primary landing page', 'wporg' ),
     219                'before_widget' => '<div id="%1$s" class="widget box %2$s">',
     220                'after_widget'  => '</div>',
     221                'before_title'  => '<h4 class="widget-title">',
     222                'after_title'   => '</h4>',
    203223        ) );
    204224}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-home-landing.php

    r773 r948  
    7878                        <div class="search-guide section light-gray clear">
    7979                                <div class="inner-wrap three-columns">
     80
     81                                        <?php if ( is_active_sidebar( 'landing-footer-1') ) { ?>
     82                                                <?php dynamic_sidebar( 'landing-footer-1' ); ?>
     83                                        <?php } else { ?>
     84                                                <div class="widget box"></div>
     85                                        <?php } ?>
     86
     87                                        <?php if ( is_active_sidebar( 'landing-footer-2') ) { ?>
     88                                                <?php dynamic_sidebar( 'landing-footer-2' ); ?>
     89                                        <?php } else { ?>
     90                                                <div class="widget box"></div>
     91                                        <?php } ?>
     92
    8093                                        <div class="widget box">
    81                                                 <h4 class="widget-title"><?php _e( 'Need Help?', 'devhub' ); ?></h4>
    82                                                 <ul class="unordered-list no-bullets">
    83                                                         <li><a href="#">WPHackers Mailing List</a></li>
    84                                                         <li><a href="#">WordPress Stack Exchange</a></li>
    85                                                         <li><a href="#">Core Contributor Handbook</a></li>
    86                                                 </ul>
    87                                         </div>
    88                                         <div class="widget box">
    89                                                 <h4 class="widget-title"><?php _e( 'More Resources', 'devhub' ); ?></h4>
    90                                                 <ul class="unordered-list no-bullets">
    91                                                         <li><a href="#">Intro To WordPress Development</a></li>
    92                                                         <li><a href="#">Setting Up Your Development Environment</a></li>
    93                                                         <li><a href="#">WordPress Coding Standards</a></li>
    94                                                 </ul>
    95                                         </div>
    96                                         <div class="widget box">
    97                                                 <h4 class="widget-title"><a href="#"><?php _e( 'Help Make WordPress ', 'devhub' ); ?><div class="dashicons dashicons-arrow-right-alt2"></div></a></h4>
     94                                                <h4 class="widget-title"><a href="https://make.wordpress.org/"><?php _e( 'Help Make WordPress ', 'wporg' ); ?><div class="dashicons dashicons-arrow-right-alt2"></div></a></h4>
    9895                                        </div>
    9996                                </div>
    100                         </div><!-- /search-guide -->
     97                        </div>
    10198
    10299                </div><!-- /home-landing -->
Note: See TracChangeset for help on using the changeset viewer.