@@ -10,4 +10,4 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | $context = Timber::get_context(); |
13 | -Timber::render( '404.twig', $context ); |
|
13 | +Timber::render('404.twig', $context); |
@@ -20,19 +20,19 @@ |
||
20 | 20 | |
21 | 21 | $data['title'] = 'Archive'; |
22 | 22 | if ( is_day() ) { |
23 | - $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
23 | + $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
24 | 24 | } else if ( is_month() ) { |
25 | - $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
25 | + $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
26 | 26 | } else if ( is_year() ) { |
27 | - $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
27 | + $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
28 | 28 | } else if ( is_tag() ) { |
29 | - $data['title'] = single_tag_title( '', false ); |
|
29 | + $data['title'] = single_tag_title( '', false ); |
|
30 | 30 | } else if ( is_category() ) { |
31 | - $data['title'] = single_cat_title( '', false ); |
|
32 | - array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
31 | + $data['title'] = single_cat_title( '', false ); |
|
32 | + array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
33 | 33 | } else if ( is_post_type_archive() ) { |
34 | - $data['title'] = post_type_archive_title( '', false ); |
|
35 | - array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
34 | + $data['title'] = post_type_archive_title( '', false ); |
|
35 | + array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $data['posts'] = Timber::get_posts(); |
@@ -14,27 +14,27 @@ |
||
14 | 14 | * @since Timber 0.2 |
15 | 15 | */ |
16 | 16 | |
17 | -$templates = array( 'archive.twig', 'index.twig' ); |
|
17 | +$templates = array('archive.twig', 'index.twig'); |
|
18 | 18 | |
19 | 19 | $data = Timber::get_context(); |
20 | 20 | |
21 | 21 | $data['title'] = 'Archive'; |
22 | -if ( is_day() ) { |
|
23 | - $data['title'] = 'Archive: '.get_the_date( 'D M Y' ); |
|
24 | -} else if ( is_month() ) { |
|
25 | - $data['title'] = 'Archive: '.get_the_date( 'M Y' ); |
|
26 | -} else if ( is_year() ) { |
|
27 | - $data['title'] = 'Archive: '.get_the_date( 'Y' ); |
|
28 | -} else if ( is_tag() ) { |
|
29 | - $data['title'] = single_tag_title( '', false ); |
|
30 | -} else if ( is_category() ) { |
|
31 | - $data['title'] = single_cat_title( '', false ); |
|
32 | - array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' ); |
|
33 | -} else if ( is_post_type_archive() ) { |
|
34 | - $data['title'] = post_type_archive_title( '', false ); |
|
35 | - array_unshift( $templates, 'archive-' . get_post_type() . '.twig' ); |
|
22 | +if (is_day()) { |
|
23 | + $data['title'] = 'Archive: '.get_the_date('D M Y'); |
|
24 | +} else if (is_month()) { |
|
25 | + $data['title'] = 'Archive: '.get_the_date('M Y'); |
|
26 | +} else if (is_year()) { |
|
27 | + $data['title'] = 'Archive: '.get_the_date('Y'); |
|
28 | +} else if (is_tag()) { |
|
29 | + $data['title'] = single_tag_title('', false); |
|
30 | +} else if (is_category()) { |
|
31 | + $data['title'] = single_cat_title('', false); |
|
32 | + array_unshift($templates, 'archive-'.get_query_var('cat').'.twig'); |
|
33 | +} else if (is_post_type_archive()) { |
|
34 | + $data['title'] = post_type_archive_title('', false); |
|
35 | + array_unshift($templates, 'archive-'.get_post_type().'.twig'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $data['posts'] = Timber::get_posts(); |
39 | 39 | |
40 | -Timber::render( $templates, $data ); |
|
40 | +Timber::render($templates, $data); |
@@ -13,8 +13,8 @@ |
||
13 | 13 | $data = Timber::get_context(); |
14 | 14 | $data['posts'] = Timber::get_posts(); |
15 | 15 | if ( isset( $wp_query->query_vars['author'] ) ) { |
16 | - $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
17 | - $data['author'] = $author; |
|
18 | - $data['title'] = 'Author Archives: ' . $author->name(); |
|
16 | + $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
17 | + $data['author'] = $author; |
|
18 | + $data['title'] = 'Author Archives: ' . $author->name(); |
|
19 | 19 | } |
20 | 20 | Timber::render( array( 'author.twig', 'archive.twig' ), $data ); |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | $data = Timber::get_context(); |
14 | 14 | $data['posts'] = Timber::get_posts(); |
15 | -if ( isset( $wp_query->query_vars['author'] ) ) { |
|
16 | - $author = new TimberUser( $wp_query->query_vars['author'] ); |
|
15 | +if (isset($wp_query->query_vars['author'])) { |
|
16 | + $author = new TimberUser($wp_query->query_vars['author']); |
|
17 | 17 | $data['author'] = $author; |
18 | - $data['title'] = 'Author Archives: ' . $author->name(); |
|
18 | + $data['title'] = 'Author Archives: '.$author->name(); |
|
19 | 19 | } |
20 | -Timber::render( array( 'author.twig', 'archive.twig' ), $data ); |
|
20 | +Timber::render(array('author.twig', 'archive.twig'), $data); |
@@ -10,22 +10,22 @@ |
||
10 | 10 | |
11 | 11 | <section class="no-results not-found"> |
12 | 12 | <header class="page-header"> |
13 | - <h1 class="page-title"><?php _e( 'Nothing Found', 'stash' ); ?></h1> |
|
13 | + <h1 class="page-title"><?php _e('Nothing Found', 'stash'); ?></h1> |
|
14 | 14 | </header><!-- .page-header --> |
15 | 15 | |
16 | 16 | <div class="page-content"> |
17 | - <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> |
|
17 | + <?php if (is_home() && current_user_can('publish_posts')) : ?> |
|
18 | 18 | |
19 | - <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'stash' ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> |
|
19 | + <p><?php printf(__('Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'stash'), esc_url(admin_url('post-new.php'))); ?></p> |
|
20 | 20 | |
21 | - <?php elseif ( is_search() ) : ?> |
|
21 | + <?php elseif (is_search()) : ?> |
|
22 | 22 | |
23 | - <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash' ); ?></p> |
|
23 | + <p><?php _e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash'); ?></p> |
|
24 | 24 | <?php get_search_form(); ?> |
25 | 25 | |
26 | 26 | <?php else : ?> |
27 | 27 | |
28 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); ?></p> |
|
28 | + <p><?php _e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash'); ?></p> |
|
29 | 29 | <?php get_search_form(); ?> |
30 | 30 | |
31 | 31 | <?php endif; ?> |
@@ -23,9 +23,12 @@ |
||
23 | 23 | <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'stash' ); ?></p> |
24 | 24 | <?php get_search_form(); ?> |
25 | 25 | |
26 | - <?php else : ?> |
|
26 | + <?php else { |
|
27 | + : ?> |
|
27 | 28 | |
28 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); ?></p> |
|
29 | + <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'stash' ); |
|
30 | +} |
|
31 | +?></p> |
|
29 | 32 | <?php get_search_form(); ?> |
30 | 33 | |
31 | 34 | <?php endif; ?> |
@@ -10,9 +10,9 @@ |
||
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
12 | 12 | <header class="entry-header"> |
13 | - <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> |
|
13 | + <?php the_title(sprintf('<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>'); ?> |
|
14 | 14 | |
15 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
15 | + <?php if ('post' == get_post_type()) : ?> |
|
16 | 16 | <div class="entry-meta"> |
17 | 17 | <?php stash_posted_on(); ?> |
18 | 18 | </div><!-- .entry-meta --> |
@@ -5,7 +5,7 @@ |
||
5 | 5 | */ |
6 | 6 | $timberContext = $GLOBALS['timberContext']; |
7 | 7 | if ( ! isset( $timberContext ) ) { |
8 | - throw new \Exception( 'Timber context not set in footer.' ); |
|
8 | + throw new \Exception( 'Timber context not set in footer.' ); |
|
9 | 9 | } |
10 | 10 | $timberContext['content'] = ob_get_contents(); |
11 | 11 | ob_end_clean(); |
@@ -4,10 +4,10 @@ |
||
4 | 4 | * We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template. |
5 | 5 | */ |
6 | 6 | $timberContext = $GLOBALS['timberContext']; |
7 | -if ( ! isset( $timberContext ) ) { |
|
8 | - throw new \Exception( 'Timber context not set in footer.' ); |
|
7 | +if (!isset($timberContext)) { |
|
8 | + throw new \Exception('Timber context not set in footer.'); |
|
9 | 9 | } |
10 | 10 | $timberContext['content'] = ob_get_contents(); |
11 | 11 | ob_end_clean(); |
12 | -$templates = array( 'page-plugin.twig' ); |
|
13 | -Timber::render( $templates, $timberContext ); |
|
12 | +$templates = array('page-plugin.twig'); |
|
13 | +Timber::render($templates, $timberContext); |
@@ -55,8 +55,10 @@ |
||
55 | 55 | foreach ($list_searcheable_acf as $searcheable_acf) : |
56 | 56 | if ($searcheable_acf == $list_searcheable_acf[0]): |
57 | 57 | $where .= " (meta_key LIKE '%" . $searcheable_acf . "%' AND meta_value LIKE '%$tag%') "; |
58 | - else : |
|
58 | + else { |
|
59 | + : |
|
59 | 60 | $where .= " OR (meta_key LIKE '%" . $searcheable_acf . "%' AND meta_value LIKE '%$tag%') "; |
61 | + } |
|
60 | 62 | endif; |
61 | 63 | endforeach; |
62 | 64 |
@@ -54,9 +54,9 @@ |
||
54 | 54 | |
55 | 55 | foreach ($list_searcheable_acf as $searcheable_acf) : |
56 | 56 | if ($searcheable_acf == $list_searcheable_acf[0]): |
57 | - $where .= " (meta_key LIKE '%" . $searcheable_acf . "%' AND meta_value LIKE '%$tag%') "; |
|
57 | + $where .= " (meta_key LIKE '%".$searcheable_acf."%' AND meta_value LIKE '%$tag%') "; |
|
58 | 58 | else : |
59 | - $where .= " OR (meta_key LIKE '%" . $searcheable_acf . "%' AND meta_value LIKE '%$tag%') "; |
|
59 | + $where .= " OR (meta_key LIKE '%".$searcheable_acf."%' AND meta_value LIKE '%$tag%') "; |
|
60 | 60 | endif; |
61 | 61 | endforeach; |
62 | 62 |
@@ -7,4 +7,4 @@ |
||
7 | 7 | * @subpackage Timber |
8 | 8 | */ |
9 | 9 | |
10 | -Timber::render( array( 'sidebar.twig' ), $data ); |
|
10 | +Timber::render(array('sidebar.twig'), $data); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $context['comment_form'] = TimberHelper::get_comment_form(); |
17 | 17 | |
18 | 18 | if ( post_password_required( $post->ID ) ) { |
19 | - Timber::render( 'single-password.twig', $context ); |
|
19 | + Timber::render( 'single-password.twig', $context ); |
|
20 | 20 | } else { |
21 | - Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context ); |
|
21 | + Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context ); |
|
22 | 22 | } |
@@ -12,11 +12,11 @@ |
||
12 | 12 | $context = Timber::get_context(); |
13 | 13 | $post = Timber::query_post(); |
14 | 14 | $context['post'] = $post; |
15 | -$context['wp_title'] .= ' - ' . $post->title(); |
|
15 | +$context['wp_title'] .= ' - '.$post->title(); |
|
16 | 16 | $context['comment_form'] = TimberHelper::get_comment_form(); |
17 | 17 | |
18 | -if ( post_password_required( $post->ID ) ) { |
|
19 | - Timber::render( 'single-password.twig', $context ); |
|
18 | +if (post_password_required($post->ID)) { |
|
19 | + Timber::render('single-password.twig', $context); |
|
20 | 20 | } else { |
21 | - Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context ); |
|
21 | + Timber::render(array('single-'.$post->ID.'.twig', 'single-'.$post->post_type.'.twig', 'single.twig'), $context); |
|
22 | 22 | } |