@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package stash |
|
| 4 | - */ |
|
| 3 | + * @package stash |
|
| 4 | + */ |
|
| 5 | 5 | ?> |
| 6 | 6 | |
| 7 | 7 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -17,19 +17,19 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <div class="entry-content"> |
| 19 | 19 | <?php |
| 20 | - /* translators: %s: Name of current post */ |
|
| 21 | - the_content( sprintf( |
|
| 22 | - __( 'Continue reading %s <span class="meta-nav">→</span>', 'stash' ), |
|
| 23 | - the_title( '<span class="screen-reader-text">"', '"</span>', false ) |
|
| 24 | - ) ); |
|
| 25 | - ?> |
|
| 20 | + /* translators: %s: Name of current post */ |
|
| 21 | + the_content( sprintf( |
|
| 22 | + __( 'Continue reading %s <span class="meta-nav">→</span>', 'stash' ), |
|
| 23 | + the_title( '<span class="screen-reader-text">"', '"</span>', false ) |
|
| 24 | + ) ); |
|
| 25 | + ?> |
|
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | - wp_link_pages( array( |
|
| 29 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
| 30 | - 'after' => '</div>', |
|
| 31 | - ) ); |
|
| 32 | - ?> |
|
| 28 | + wp_link_pages( array( |
|
| 29 | + 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
| 30 | + 'after' => '</div>', |
|
| 31 | + ) ); |
|
| 32 | + ?> |
|
| 33 | 33 | </div><!-- .entry-content --> |
| 34 | 34 | |
| 35 | 35 | <footer class="entry-footer"> |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
| 8 | 8 | <header class="entry-header"> |
| 9 | - <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> |
|
| 9 | + <?php the_title(sprintf('<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a></h1>'); ?> |
|
| 10 | 10 | |
| 11 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
| 11 | + <?php if ('post' == get_post_type()) : ?> |
|
| 12 | 12 | <div class="entry-meta"> |
| 13 | 13 | <?php stash_posted_on(); ?> |
| 14 | 14 | </div><!-- .entry-meta --> |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | <div class="entry-content"> |
| 19 | 19 | <?php |
| 20 | 20 | /* translators: %s: Name of current post */ |
| 21 | - the_content( sprintf( |
|
| 22 | - __( 'Continue reading %s <span class="meta-nav">→</span>', 'stash' ), |
|
| 23 | - the_title( '<span class="screen-reader-text">"', '"</span>', false ) |
|
| 24 | - ) ); |
|
| 21 | + the_content(sprintf( |
|
| 22 | + __('Continue reading %s <span class="meta-nav">→</span>', 'stash'), |
|
| 23 | + the_title('<span class="screen-reader-text">"', '"</span>', false) |
|
| 24 | + )); |
|
| 25 | 25 | ?> |
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | - wp_link_pages( array( |
|
| 29 | - 'before' => '<div class="page-links">' . __( 'Pages:', 'stash' ), |
|
| 28 | + wp_link_pages(array( |
|
| 29 | + 'before' => '<div class="page-links">' . __('Pages:', 'stash'), |
|
| 30 | 30 | 'after' => '</div>', |
| 31 | - ) ); |
|
| 31 | + )); |
|
| 32 | 32 | ?> |
| 33 | 33 | </div><!-- .entry-content --> |
| 34 | 34 | |
@@ -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); |
|
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | use Twig_Extension_StringLoader; |
| 7 | 7 | |
| 8 | 8 | if (!class_exists('Timber')) { |
| 9 | - add_action('admin_notices', function () { |
|
| 9 | + add_action('admin_notices', function() { |
|
| 10 | 10 | echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url(admin_url('plugins.php#timber')) . '">' . esc_url(admin_url('plugins.php')) . '</a></p></div>'; |
| 11 | 11 | }); |
| 12 | 12 | |
@@ -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 | |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | * @since Timber 0.1 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -$templates = array( 'search.twig', 'archive.twig', 'index.twig' ); |
|
| 12 | +$templates = array('search.twig', 'archive.twig', 'index.twig'); |
|
| 13 | 13 | $context = Timber::get_context(); |
| 14 | 14 | |
| 15 | -$context['title'] = 'Search results for '. get_search_query(); |
|
| 15 | +$context['title'] = 'Search results for ' . get_search_query(); |
|
| 16 | 16 | $context['posts'] = Timber::get_posts(); |
| 17 | 17 | |
| 18 | -Timber::render( $templates, $context ); |
|
| 18 | +Timber::render($templates, $context); |
|
@@ -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 | } |
@@ -15,8 +15,8 @@ |
||
| 15 | 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 | } |