Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout 3 colonnes #137

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions theme/front-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,29 @@
<?php dynamic_sidebar('homepage-top') ?>
</div>
<?php endif;
if ('posts' == get_option('show_on_front')) :
if (is_active_sidebar('homepage-one-half') || is_active_sidebar('homepage-two-half')) : ?>
<div id="widget-homepage-half" class="section home-widget-container">
<div class="container padded">
<div class="row">
<?php dynamic_sidebar('homepage-one-half') ?>
<?php dynamic_sidebar('homepage-two-half') ?>
</div>
</div>
</div>
<?php endif;
if (is_active_sidebar('homepage-one-third') || is_active_sidebar('homepage-two-third') || is_active_sidebar('homepage-three-third')) : ?>
<div id="widget-homepage-third" class="section home-widget-container">
<div class="container padded">
<div class="row">
<?php dynamic_sidebar('homepage-one-third') ?>
<?php dynamic_sidebar('homepage-two-third') ?>
<?php dynamic_sidebar('homepage-three-third') ?>
</div>
</div>
</div>
<?php endif;
include get_home_template();
else :
include get_page_template();
endif;
dynamic_sidebar('homepage-bottom');
dynamic_sidebar('homepage-bottom');
if (!is_paged() && get_field('global_module_social', 'option') == 'oui') :
get_template_part('templates/module', 'home-social');
endif;
Expand Down
46 changes: 46 additions & 0 deletions theme/lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,52 @@ function widgets_init() {
// 'before_title' => '<h2 class="flex-widget__title">',
// 'after_title' => '</h2>'
// ]);

// Two columns layout
register_sidebar([
'name' => '[Deux colonnes] Première colonne', // TODO translate
'id' => 'homepage-one-half',
'before_widget' => '<div class=" %1$s %2$s col-md-6"><div id="homepage-one-half">',
'after_widget' => '</div></div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
]);
register_sidebar([
'name' => '[Deux colonnes] Seconde colonne', // TODO translate
'id' => 'homepage-two-half',
'before_widget' => '<div class=" %1$s %2$s col-md-6"><div id="homepage-two-half">',
'after_widget' => '</div></div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
]);
//

// Three columns layout
register_sidebar([
'name' => '[Trois colonnes] Première colonne', // TODO translate
'id' => 'homepage-one-third',
'before_widget' => '<div class=" %1$s %2$s col-md-4"><div id="homepage-one-third">',
'after_widget' => '</div></div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
]);
register_sidebar([
'name' => '[Trois colonnes] Seconde colonne', // TODO translate
'id' => 'homepage-two-third',
'before_widget' => '<div class=" %1$s %2$s col-md-4"><div id="homepage-two-third">',
'after_widget' => '</div></div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
]);
register_sidebar([
'name' => '[Trois colonnes] Troisième colonne', // TODO translate
'id' => 'homepage-three-third',
'before_widget' => '<div class=" %1$s %2$s col-md-4"><div id="homepage-top-three-third">',
'after_widget' => '</div></div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
]);
//
register_sidebar([
'name' => 'Bas de page', // TODO translate
'id' => 'homepage-bottom',
Expand Down