Fixing double echo's, template cleanup

This commit is contained in:
Kalen Johnson
2016-12-06 15:24:15 -08:00
parent b7742fd86f
commit 3dadb86ec2
14 changed files with 43 additions and 49 deletions

View File

@@ -3,9 +3,9 @@
@section('content') @section('content')
@include('partials.page-header') @include('partials.page-header')
@if(!have_posts()) @if (!have_posts())
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }} {{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }}
</div> </div>
{!! get_search_form(false) !!} {!! get_search_form(false) !!}
@endif @endif

View File

@@ -3,17 +3,16 @@
@section('content') @section('content')
@include('partials.page-header') @include('partials.page-header')
@if(!have_posts()) @if (!have_posts())
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Sorry, no results were found.', 'sage') }} {{ __('Sorry, no results were found.', 'sage') }}
</div> </div>
{{ get_search_form(false) }} {!! get_search_form(false) !!}
@endif @endif
@while(have_posts()) @while (have_posts()) @php the_post() @endphp
{!! the_post() !!} @include ('partials.content')
@include('partials.content')
@endwhile @endwhile
{{ get_the_posts_navigation() }} {!! get_the_posts_navigation() !!}
@endsection @endsection

View File

@@ -1,28 +1,28 @@
<!doctype html> <!doctype html>
<html {!! language_attributes() !!}> <html @php language_attributes() @endphp>
@include('partials.head') @include('partials.head')
<body {!! body_class() !!}> <body @php body_class() @endphp>
<!--[if IE]> <!--[if IE]>
<div class="alert alert-warning"> <div class="alert alert-warning">
{!! _e('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'sage') !!} {!! __('You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.', 'sage') !!}
</div> </div>
<![endif]--> <![endif]-->
{!! do_action('get_header') !!} @php do_action('get_header') @endphp
@include('partials.header') @include('partials.header')
<div class="wrap container" role="document"> <div class="wrap container" role="document">
<div class="content row"> <div class="content row">
<main class="main"> <main class="main">
@yield('content') @yield('content')
</main> </main>
@if(App\display_sidebar()) @if (App\display_sidebar())
<aside class="sidebar"> <aside class="sidebar">
@include('partials.sidebar') @include('partials.sidebar')
</aside> </aside>
@endif @endif
</div> </div>
</div> </div>
{!! do_action('get_footer') !!} @php do_action('get_footer') @endphp
@include('partials.footer') @include('partials.footer')
{!! wp_footer() !!} @php wp_footer() @endphp
</body> </body>
</html> </html>

View File

@@ -1,8 +1,7 @@
@extends('layouts.base') @extends('layouts.base')
@section('content') @section('content')
@while(have_posts()) @while(have_posts()) @php the_post() @endphp
{!! the_post() !!}
@include('partials.page-header') @include('partials.page-header')
@include('partials.content-page') @include('partials.content-page')
@endwhile @endwhile

View File

@@ -1,11 +1,11 @@
<?php @php
if (post_password_required()) { if (post_password_required()) {
return; return;
} }
?> @endphp
<section id="comments" class="comments"> <section id="comments" class="comments">
@if(have_comments()) @if (have_comments())
<h2> <h2>
{!! sprintf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!} {!! sprintf(_nx('One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!}
</h2> </h2>
@@ -14,13 +14,13 @@ if (post_password_required()) {
{!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!} {!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!}
</ol> </ol>
@if(get_comment_pages_count() > 1 && get_option('page_comments')) @if (get_comment_pages_count() > 1 && get_option('page_comments'))
<nav> <nav>
<ul class="pager"> <ul class="pager">
@if(get_previous_comments_link()) @if (get_previous_comments_link())
<li class="previous">{!! previous_comments_link(__('&larr; Older comments', 'sage')) !!}</li> <li class="previous">{!! previous_comments_link(__('&larr; Older comments', 'sage')) !!}</li>
@endif @endif
@if(get_next_comments_link()) @if (get_next_comments_link())
<li class="next">{!! next_comments_link(__('Newer comments &rarr;', 'sage')) !!}</li> <li class="next">{!! next_comments_link(__('Newer comments &rarr;', 'sage')) !!}</li>
@endif @endif
</ul> </ul>
@@ -28,11 +28,11 @@ if (post_password_required()) {
@endif @endif
@endif @endif
@if(!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) @if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Comments are closed.', 'sage') }} {{ __('Comments are closed.', 'sage') }}
</div> </div>
@endif @endif
{!! comment_form() !!} @php comment_form() @endphp
</section> </section>

View File

@@ -1,2 +1,2 @@
{!! the_content() !!} @php the_content() @endphp
{!! wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!} {!! wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}

View File

@@ -1,11 +1,11 @@
<article {!! post_class() !!}> <article @php post_class() @endphp>
<header> <header>
<h2 class="entry-title"><a href="{{ get_permalink() }}">{{ get_the_title() }}</a></h2> <h2 class="entry-title"><a href="{{ get_permalink() }}">{{ get_the_title() }}</a></h2>
@if(get_post_type() === 'post') @if (get_post_type() === 'post')
@include('partials/entry-meta') @include('partials/entry-meta')
@endif @endif
</header> </header>
<div class="entry-summary"> <div class="entry-summary">
{!! the_excerpt() !!} @php the_excerpt() @endphp
</div> </div>
</article> </article>

View File

@@ -1,13 +1,13 @@
<article {!! post_class() !!}> <article @php post_class() @endphp>
<header> <header>
<h1 class="entry-title">{{ get_the_title() }}</h1> <h1 class="entry-title">{{ get_the_title() }}</h1>
@include('partials/entry-meta') @include('partials/entry-meta')
</header> </header>
<div class="entry-content"> <div class="entry-content">
{!! the_content() !!} @php the_content() @endphp
</div> </div>
<footer> <footer>
{!! wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!} {!! wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
</footer> </footer>
{!! comments_template('/templates/partials/comments.blade.php') !!} @php comments_template('/templates/partials/comments.blade.php') @endphp
</article> </article>

View File

@@ -1,9 +1,9 @@
<article {!! post_class() !!}> <article @php post_class() @endphp>
<header> <header>
<h2 class="entry-title"><a href="{{ get_permalink() }}">{{ get_the_title() }}</a></h2> <h2 class="entry-title"><a href="{{ get_permalink() }}">{{ get_the_title() }}</a></h2>
@include('partials/entry-meta') @include('partials/entry-meta')
</header> </header>
<div class="entry-summary"> <div class="entry-summary">
{!! the_excerpt() !!} @php the_excerpt() @endphp
</div> </div>
</article> </article>

View File

@@ -2,5 +2,5 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{!! wp_head() !!} @php wp_head() @endphp
</head> </head>

View File

@@ -1,8 +1,8 @@
<header class="banner"> <header class="banner">
<div class="container"> <div class="container">
<a class="brand" href="{{ esc_url(home_url('/')) }}">{{ get_bloginfo('name', 'display') }}</a> <a class="brand" href="{{ home_url('/') }}">{{ get_bloginfo('name', 'display') }}</a>
<nav class="nav-primary"> <nav class="nav-primary">
@if(has_nav_menu('primary_navigation')) @if (has_nav_menu('primary_navigation'))
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav']) !!} {!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav']) !!}
@endif @endif
</nav> </nav>

View File

@@ -3,18 +3,16 @@
@section('content') @section('content')
@include('partials.page-header') @include('partials.page-header')
@if(!have_posts()) @if (!have_posts())
<div class="alert alert-warning"> <div class="alert alert-warning">
{{ __('Sorry, no results were found.', 'sage') }} {{ __('Sorry, no results were found.', 'sage') }}
</div> </div>
{!! get_search_form(false) !!} {!! get_search_form(false) !!}
@endif @endif
@while(have_posts()) @while(have_posts()) @php the_post() @endphp
{!! the_post() !!}
@include('partials.content-search') @include('partials.content-search')
@endwhile @endwhile
{{ get_the_posts_navigation() }} {!! get_the_posts_navigation() !!}
@endsection @endsection

View File

@@ -1,8 +1,7 @@
@extends('layouts.base') @extends('layouts.base')
@section('content') @section('content')
@while(have_posts()) @while(have_posts()) @php the_post() @endphp
{!! the_post() !!}
@include('partials/content-single') @include('partials/content-single')
@endwhile @endwhile
@endsection @endsection

View File

@@ -1,14 +1,13 @@
<?php @php
/** /**
* Template Name: Custom Template * Template Name: Custom Template
*/ */
?> @endphp
@extends('layouts.base') @extends('layouts.base')
@section('content') @section('content')
@while(have_posts()) @while(have_posts()) @php the_post() @endphp
{!! the_post() !!}
@include('partials.page-header') @include('partials.page-header')
@include('partials.content-page') @include('partials.content-page')
@endwhile @endwhile