lightspeeddevelopment /
lsx
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * The Sidebar containing the main widget areas. |
||
| 4 | * |
||
| 5 | * @package lsx |
||
| 6 | */ |
||
| 7 | |||
| 8 | $sidebar_enabled = apply_filters( 'lsx_sidebar_enable', true ); |
||
| 9 | |||
| 10 | if ( true !== $sidebar_enabled ) { |
||
| 11 | return true; |
||
| 12 | } |
||
| 13 | |||
| 14 | $show_on_front = get_option( 'show_on_front' ); |
||
| 15 | |||
| 16 | if ( 'page' === $show_on_front && is_front_page() ) { |
||
| 17 | $layout = '1c'; |
||
| 18 | $sidebar = 'home'; |
||
| 19 | } else { |
||
| 20 | $layout = get_theme_mod( 'lsx_layout', '2cr' ); |
||
| 21 | $layout = apply_filters( 'lsx_layout', $layout ); |
||
| 22 | |||
| 23 | if ( 'posts' === $show_on_front && is_home() ) { |
||
| 24 | $sidebar = 'home'; |
||
| 25 | } else { |
||
| 26 | $sidebar = 'sidebar-1'; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | if ( '1c' !== $layout ) : ?> |
||
| 31 | <?php lsx_sidebars_before(); ?> |
||
| 32 | <div id="secondary" class="widget-area <?php echo esc_attr( lsx_sidebar_class() ); ?>" role="complementary"> |
||
| 33 | |||
| 34 | <?php lsx_sidebar_top(); ?> |
||
| 35 | |||
| 36 | <?php if ( ! dynamic_sidebar( $sidebar ) ) : ?> |
||
| 37 | |||
| 38 | <aside id="search" class="widget widget_search"> |
||
| 39 | <?php get_search_form(); ?> |
||
| 40 | </aside> |
||
| 41 | |||
| 42 | <aside id="archives" class="widget"> |
||
| 43 | <h1 class="widget-title"><?php esc_html_e( 'Archives', 'lsx' ); ?></h1> |
||
| 44 | |||
| 45 | <ul> |
||
| 46 | <?php |
||
| 47 | wp_get_archives( array( |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 48 | 'type' => 'monthly', |
||
| 49 | ) ); |
||
|
0 ignored issues
–
show
For multi-line function calls, the closing parenthesis should be on a new line.
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line: someFunctionCall(
$firstArgument,
$secondArgument,
$thirdArgument
); // Closing parenthesis on a new line.
Loading history...
|
|||
| 50 | ?> |
||
| 51 | </ul> |
||
| 52 | </aside> |
||
| 53 | |||
| 54 | <aside id="meta" class="widget"> |
||
| 55 | <h1 class="widget-title"><?php esc_html_e( 'Meta', 'lsx' ); ?></h1> |
||
| 56 | |||
| 57 | <ul> |
||
| 58 | <?php wp_register(); ?> |
||
| 59 | <li><?php wp_loginout(); ?></li> |
||
| 60 | <?php wp_meta(); ?> |
||
| 61 | </ul> |
||
| 62 | </aside> |
||
| 63 | |||
| 64 | <?php endif; ?> |
||
| 65 | |||
| 66 | <?php lsx_sidebar_bottom(); ?> |
||
| 67 | |||
| 68 | </div><!-- #secondary --> |
||
| 69 | |||
| 70 | <?php lsx_sidebars_after(); ?> |
||
| 71 | |||
| 72 | <?php |
||
| 73 | endif; |
||
| 74 |