From 8be2d4c9cc6e97c42a258524ccbb0d505af17a51 Mon Sep 17 00:00:00 2001 From: "Jorge hangar.org" Date: Thu, 17 Mar 2022 14:14:25 +0100 Subject: [PATCH] added two new widget areas to front page --- library/widget-areas.php | 26 +++++++++++++++++++-- page-templates/front.php | 7 +++++- template-parts/home-announcement-bottom.php | 19 +++++++++++++++ template-parts/home-announcement-middle.php | 19 +++++++++++++++ template-parts/section-news.php | 4 ++-- 5 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 template-parts/home-announcement-bottom.php create mode 100644 template-parts/home-announcement-middle.php diff --git a/library/widget-areas.php b/library/widget-areas.php index 87b30ae..54893ba 100644 --- a/library/widget-areas.php +++ b/library/widget-areas.php @@ -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' => '
', + 'description' => __( 'Drag widgets to this Home page container that will show at the top.', 'foundationpress' ), + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '
', + 'after_title' => '
', + ) + ); + 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' => '
', + 'after_widget' => '
', + 'before_title' => '
', + 'after_title' => '
', + ) + ); + 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' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', diff --git a/page-templates/front.php b/page-templates/front.php index 44c8fcc..71eaa3b 100644 --- a/page-templates/front.php +++ b/page-templates/front.php @@ -12,5 +12,10 @@ get_header(); ?>
- + + + + + + +
+
+ +
+ +
diff --git a/template-parts/home-announcement-middle.php b/template-parts/home-announcement-middle.php new file mode 100644 index 0000000..805bf60 --- /dev/null +++ b/template-parts/home-announcement-middle.php @@ -0,0 +1,19 @@ + +
+
+ +
+ +
diff --git a/template-parts/section-news.php b/template-parts/section-news.php index fae04d3..38e4545 100644 --- a/template-parts/section-news.php +++ b/template-parts/section-news.php @@ -10,10 +10,10 @@
-

+

News

- 'news', 'posts_per_page' => 6 ) ); ?> + 'news', 'posts_per_page' => 3 ) ); ?> have_posts() ) : ?> have_posts() ) : $the_query->the_post(); ?>