added two new widget areas to front page

This commit is contained in:
jorge 2022-03-17 14:14:25 +01:00
parent c2ce660a53
commit 8be2d4c9cc
5 changed files with 70 additions and 5 deletions

View File

@ -12,8 +12,30 @@ if ( ! function_exists( 'foundationpress_sidebar_widgets' ) ) :
array(
'id' => 'home-announcement-widgets',
'name' => __( 'Home Announcement widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container.', 'foundationpress' ),
'before_widget' => '<section id="%1$s" class="widget slide %2$s">',
'description' => __( 'Drag widgets to this Home page container that will show at the top.', 'foundationpress' ),
'before_widget' => '<section id="%1$s" class="widget slide home-announcement %2$s">',
'after_widget' => '</section>',
'before_title' => '<h6>',
'after_title' => '</h6>',
)
);
register_sidebar(
array(
'id' => 'home-announcement-middle-widgets',
'name' => __( 'Home Announcement Middle widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container that will show in the middle.', 'foundationpress' ),
'before_widget' => '<section id="%1$s" class="widget slide home-middle-announcement %2$s">',
'after_widget' => '</section>',
'before_title' => '<h6>',
'after_title' => '</h6>',
)
);
register_sidebar(
array(
'id' => 'home-announcement-bottom-widgets',
'name' => __( 'Home Announcement Bottom widgets', 'foundationpress' ),
'description' => __( 'Drag widgets to this Home page container that will show at the bottom.', 'foundationpress' ),
'before_widget' => '<section id="%1$s" class="widget slide home-bottom-announcement %2$s">',
'after_widget' => '</section>',
'before_title' => '<h6>',
'after_title' => '</h6>',

View File

@ -13,4 +13,9 @@ get_header(); ?>
<?php get_template_part( 'template-parts/section', 'news' ); ?>
</main>
</article>
<?php get_template_part( 'template-parts/home', 'announcement-middle' ); ?>
<?php get_template_part( 'template-parts/home', 'announcement-bottom' ); ?>
<?php get_footer();

View File

@ -0,0 +1,19 @@
<?php
/**
* The breaking div containing the main widget area
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<section class="hero">
<main class="slides">
<?php dynamic_sidebar( 'home-announcement-bottom-widgets' ); ?>
</main>
<aside>
<nav>
<?php //foundationpress_home_hero_bar(); ?>
</nav>
</aside>
</section>

View File

@ -0,0 +1,19 @@
<?php
/**
* The breaking div containing the main widget area
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
?>
<section class="hero">
<main class="slides">
<?php dynamic_sidebar( 'home-announcement-middle-widgets' ); ?>
</main>
<aside>
<nav>
<?php //foundationpress_home_hero_bar(); ?>
</nav>
</aside>
</section>

View File

@ -10,10 +10,10 @@
<section class="category-posts news">
<header>
<h2> <?php single_term_title( );?></h2>
<h2> News </h2>
</header>
<main class="">
<?php $the_query = new WP_Query( array( 'category_name' => 'news', 'posts_per_page' => 6 ) ); ?>
<?php $the_query = new WP_Query( array( 'category_name' => 'news', 'posts_per_page' => 3 ) ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php //the loop ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>