mods in the theme to show widget area at top of home page
This commit is contained in:
parent
189cff9bfc
commit
885acdc298
|
@ -10,6 +10,15 @@
|
|||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php if( is_home( )) : ?>
|
||||
<?php // show big widget area if homepage and if active ?>
|
||||
<aside class="hero">
|
||||
<?php if ( ! dynamic_sidebar( 'secondary-widget-area' ) ) : ?>
|
||||
<?php endif; // end secondary widget area ?>
|
||||
</aside>
|
||||
<?php endif; //end if is_home ?>
|
||||
|
||||
<div id="main" class="maingran">
|
||||
<div id="content" class="narrowcolumn indexall"> <!-- esborrar class narrowcolumn -->
|
||||
|
||||
|
|
|
@ -10,6 +10,12 @@
|
|||
|
||||
<div id="main">
|
||||
|
||||
<?php if( is_home( )) : ?>
|
||||
<aside class="hero">
|
||||
<?php if ( ! dynamic_sidebar( 'secondary-widget-area' ) ) : ?>
|
||||
<?php endif; // end secondary widget area ?>
|
||||
</aside>
|
||||
<?php endif; //end if is_home ?>
|
||||
<div id="content">
|
||||
<?php get_template_part( 'loop', 'index' ); ?>
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@ function ari_widgets_init() {
|
|||
register_sidebar( array(
|
||||
'name' => __( 'Primary Widget Area', 'hangar' ),
|
||||
'id' => 'primary-widget-area',
|
||||
'description' => __( 'Here you can put one or two of your main widgets (like an intro text, your page navigation or some social site links) in your left sidebar. The sidebar is fixed, so the widgets content will always be visible, even when scrolling down the page.', 'ari' ),
|
||||
'description' => __( 'Here you can put all the widget elements to be shown in the left side menu.', 'ari' ),
|
||||
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
|
@ -18,15 +18,15 @@ function ari_widgets_init() {
|
|||
register_sidebar( array(
|
||||
'name' => __( 'Secondary Widget Area', 'hangar' ),
|
||||
'id' => 'secondary-widget-area',
|
||||
'description' => __( 'Here you can put all the additional widgets for your right sidebar.', 'hangar' ),
|
||||
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
|
||||
'after_widget' => '</li>',
|
||||
'before_title' => '<h3 class="widget-title">',
|
||||
'after_title' => '</h3>',
|
||||
'description' => __( 'Here you can put all the additional widgets elements to be shown in the HomePage big announcement.', 'hangar' ),
|
||||
'before_widget' => '<span id="%1$s" class="widget-container %2$s">',
|
||||
'after_widget' => '</span>',
|
||||
'before_title' => '<span class="widget-title">',
|
||||
'after_title' => '</span>',
|
||||
) );
|
||||
|
||||
}
|
||||
/* Register sidebars by running ari_widgets_init() on the widgets_init hook. */
|
||||
add_action( 'widgets_init', 'ari_widgets_init' );
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<aside class="hero">
|
||||
<?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
|
||||
</aside>
|
||||
<?php /* Start the Loop. */ ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
|
@ -42,4 +45,4 @@
|
|||
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
|
||||
<p class="previous"><?php next_posts_link( __( '← Older posts', 'hangar' ) ); ?></p>
|
||||
<p class="next"><?php previous_posts_link( __( 'Newer posts →', 'hangar' ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Reference in New Issue