From a7e9b574a3bd889830b404770fe3a5b12843b59f Mon Sep 17 00:00:00 2001 From: Fabiano Alencar Date: Thu, 22 Feb 2018 16:45:49 -0300 Subject: [PATCH] ADD loop on index and single with sidebar. --- src/functions/setup.php | 20 ++++++- src/index.php | 8 +-- src/single.php | 18 +++++-- .../{loop.php => index-loop.php} | 4 +- src/template-parts/single-post.php | 53 +++++++++++++++++++ 5 files changed, 92 insertions(+), 11 deletions(-) rename src/template-parts/{loop.php => index-loop.php} (93%) create mode 100644 src/template-parts/single-post.php diff --git a/src/functions/setup.php b/src/functions/setup.php index 0ec5f79..df60db5 100644 --- a/src/functions/setup.php +++ b/src/functions/setup.php @@ -23,4 +23,22 @@ if(!function_exists('tainacan_setup')) { } } -add_action( 'after_setup_theme', 'tainacan_setup' ); \ No newline at end of file +add_action( 'after_setup_theme', 'tainacan_setup' ); + +if ( ! function_exists( 'tainacan_post_date' ) ) { + function tainacan_post_date() { + if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { + $time_string = ''; + if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { + $time_string = ' '; + } + $time_string = sprintf( $time_string, + esc_attr( get_the_date( 'c' ) ), + get_the_date(), + esc_attr( get_the_modified_date( 'c' ) ), + get_the_modified_date() + ); + echo $time_string; + } + } +} \ No newline at end of file diff --git a/src/index.php b/src/index.php index 7eb1de3..87aaa1b 100644 --- a/src/index.php +++ b/src/index.php @@ -1,10 +1,10 @@
-
- - - +
+
+ +
diff --git a/src/single.php b/src/single.php index 443e657..7824515 100644 --- a/src/single.php +++ b/src/single.php @@ -1,7 +1,17 @@ - -get_header(); +
+
-get_template_part('template-parts/loop'); +
+
+ +
+
-get_footer(); \ No newline at end of file + + +
+
+ + \ No newline at end of file diff --git a/src/template-parts/loop.php b/src/template-parts/index-loop.php similarity index 93% rename from src/template-parts/loop.php rename to src/template-parts/index-loop.php index dd4c7f3..8ebccd5 100644 --- a/src/template-parts/loop.php +++ b/src/template-parts/index-loop.php @@ -1,12 +1,12 @@ -
+
diff --git a/src/template-parts/single-post.php b/src/template-parts/single-post.php new file mode 100644 index 0000000..e1aa29c --- /dev/null +++ b/src/template-parts/single-post.php @@ -0,0 +1,53 @@ + +
> +
+

+ +

+
+ +
+
+
+ +
+
+

+ | | : +

+
+ +
+

+

+ +
+
+
+
+ +
+
+ Previous post: '.'%title'); ?> +
+
+ '); ?> +
+
\ No newline at end of file