-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix codestyles and better phpcs file (#164)
- Loading branch information
Showing
11 changed files
with
95 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* The template for displaying Archive pages. | ||
* | ||
* Used to display archive-type pages if nothing more specific matches a query. | ||
* For example, puts together date-based pages if no date.php file exists. | ||
* | ||
* Learn more: https://developer.wordpress.org/themes/basics/template-hierarchy/ | ||
* | ||
*/ | ||
|
||
namespace App; | ||
|
||
use Timber\Timber; | ||
|
||
$templates = array('templates/archive.twig', 'templates/index.twig'); | ||
$templates = [ 'templates/archive.twig', 'templates/index.twig' ]; | ||
|
||
$title = 'Archive'; | ||
if (is_day()) { | ||
$title = 'Archive: ' . get_the_date('D M Y'); | ||
} elseif (is_month()) { | ||
$title = 'Archive: ' . get_the_date('M Y'); | ||
} elseif (is_year()) { | ||
$title = 'Archive: ' . get_the_date('Y'); | ||
} elseif (is_tag()) { | ||
$title = single_tag_title('', false); | ||
} elseif (is_category()) { | ||
$title = single_cat_title('', false); | ||
} elseif (is_post_type_archive()) { | ||
$title = post_type_archive_title('', false); | ||
array_unshift($templates, 'templates/archive-' . get_post_type() . '.twig'); | ||
if ( is_day() ) { | ||
$title = 'Archive: ' . get_the_date( 'D M Y' ); | ||
} elseif ( is_month() ) { | ||
$title = 'Archive: ' . get_the_date( 'M Y' ); | ||
} elseif ( is_year() ) { | ||
$title = 'Archive: ' . get_the_date( 'Y' ); | ||
} elseif ( is_tag() ) { | ||
$title = single_tag_title( '', false ); | ||
} elseif ( is_category() ) { | ||
$title = single_cat_title( '', false ); | ||
} elseif ( is_post_type_archive() ) { | ||
$title = post_type_archive_title( '', false ); | ||
array_unshift( $templates, 'templates/archive-' . get_post_type() . '.twig' ); | ||
} | ||
|
||
$context = Timber::context([ | ||
'title' => $title, | ||
]); | ||
$context = Timber::context( | ||
[ | ||
'title' => $title, | ||
] | ||
); | ||
|
||
Timber::render($templates, $context); | ||
Timber::render( $templates, $context ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
|
||
/** | ||
* Functions and definitions | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* Search results page | ||
* | ||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ | ||
*/ | ||
|
||
use Timber\Timber; | ||
|
||
$templates = array( 'templates/search.twig', 'templates/archive.twig', 'templates/index.twig' ); | ||
$templates = [ 'templates/search.twig', 'templates/archive.twig', 'templates/index.twig' ]; | ||
|
||
$context = Timber::context([ | ||
'title' => 'Search results for ' . get_search_query(), | ||
]); | ||
$context = Timber::context( | ||
[ | ||
'title' => 'Search results for ' . get_search_query(), | ||
] | ||
); | ||
|
||
Timber::render($templates, $context); | ||
Timber::render( $templates, $context ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* The Template for displaying all single posts | ||
* | ||
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ | ||
*/ | ||
|
||
namespace App; | ||
|
||
use Timber\Timber; | ||
|
||
$context = Timber::context(); | ||
$post = $context['post']; | ||
$templates = array('templates/single-' . $post->post_type . '.twig', 'templates/single.twig'); | ||
$context = Timber::context(); | ||
$post = $context['post']; | ||
$templates = [ 'templates/single-' . $post->post_type . '.twig', 'templates/single.twig' ]; | ||
|
||
if (post_password_required($post->ID)) { | ||
if ( post_password_required( $post->ID ) ) { | ||
$templates = 'templates/single-password.twig'; | ||
} | ||
} | ||
|
||
Timber::render($templates, $context); | ||
Timber::render( $templates, $context ); |
Oops, something went wrong.