From 3929c97ac531cf67406e1d1928a9e8f84385d29e Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Wed, 28 Dec 2022 21:56:26 +0100 Subject: [PATCH] added support for custom fields and front page show --- page-templates/front-page.php | 53 +++++++++++ page.php | 14 ++- single.php | 4 +- template-parts/frontpage-widgets.php | 14 --- template-parts/section-featured.php | 70 +++++++++++++++ .../section-posts-from-category.php | 89 +++++++++++++++++++ .../section-posts-from-custom-type.php | 73 +++++++++++++++ 7 files changed, 293 insertions(+), 24 deletions(-) create mode 100644 page-templates/front-page.php delete mode 100644 template-parts/frontpage-widgets.php create mode 100644 template-parts/section-featured.php create mode 100644 template-parts/section-posts-from-category.php create mode 100644 template-parts/section-posts-from-custom-type.php diff --git a/page-templates/front-page.php b/page-templates/front-page.php new file mode 100644 index 0000000..bb159e3 --- /dev/null +++ b/page-templates/front-page.php @@ -0,0 +1,53 @@ + + +
+ + +
+

+
+ + +
+ + - '' . esc_html__( 'Previous:', 'ofisuport' ) . ' %title', - 'next_text' => '' . esc_html__( 'Next:', 'ofisuport' ) . ' %title', + 'prev_text' => '' . esc_html__( 'Anterior:', 'ofisuport' ) . ' %title', + 'next_text' => '' . esc_html__( 'Següent:', 'ofisuport' ) . ' %title', ) ); diff --git a/template-parts/frontpage-widgets.php b/template-parts/frontpage-widgets.php deleted file mode 100644 index 3f5c3d8..0000000 --- a/template-parts/frontpage-widgets.php +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/template-parts/section-featured.php b/template-parts/section-featured.php new file mode 100644 index 0000000..6ee9e96 --- /dev/null +++ b/template-parts/section-featured.php @@ -0,0 +1,70 @@ + + + diff --git a/template-parts/section-posts-from-category.php b/template-parts/section-posts-from-category.php new file mode 100644 index 0000000..44eda53 --- /dev/null +++ b/template-parts/section-posts-from-category.php @@ -0,0 +1,89 @@ + + + 'news', 'post_per_page' => '3' ) ); + $thiscategory = $args['category_name']; + $howmanyposts = $args['post_per_page']; + ?> + +
+
+

+ +

+
+
+ $thiscategory, 'posts_per_page' => $howmanyposts ) ); ?> + have_posts() ) : ?> + have_posts() ) : $the_query->the_post(); ?> + + +
+ + + +

+ + + +
diff --git a/template-parts/section-posts-from-custom-type.php b/template-parts/section-posts-from-custom-type.php new file mode 100644 index 0000000..e6005cc --- /dev/null +++ b/template-parts/section-posts-from-custom-type.php @@ -0,0 +1,73 @@ + + + + 'news', 'post_per_page' => '3' ) ); + $thiscustomposttype = get_post_type( get_the_ID() ); + $howmanyposts = $args['post_per_page']; +?> +
+
+

+ +

+
+
+ $thiscustomposttype, 'posts_per_page' => $howmanyposts ) ); ?> + have_posts() ) : ?> + have_posts() ) : $the_query->the_post(); ?> + + + + + +

+ +
+ +