Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Created August 1, 2023 09:03
Show Gist options
  • Save johnmccole/005f66e109a8d8bc5c268d77867d5616 to your computer and use it in GitHub Desktop.
Save johnmccole/005f66e109a8d8bc5c268d77867d5616 to your computer and use it in GitHub Desktop.
@if(!is_front_page())
@php
$term = get_queried_object();
if(is_tax()) {
$header = get_field('image', $term->taxonomy . '_' . $term->term_id);
}
@endphp
<div class="page-header alignfull d-flex pb-5 align-items-stretch vh-100 parallax-background" style="background: rgb(50, 50, 50) url(@if(is_tax()) {!! $header['url'] !!} @else {!! the_post_thumbnail_url() !!} @endif) no-repeat center / cover; margin: 0 -15px;">
<div class="container-fluid d-flex align-items-end w-100">
<div class="row w-100">
<div class="col-12 col-md-4 offset-md-1 has-white-color">
<h1 class="text-uppercase">@if(is_tax()) {!! $term->name !!} @else {!! App::title() !!} @endif</h1>
<div class="border-top border-white mt-3 mb-5 pt-4">
@if(is_tax()) {!! term_description() !!} @else {!! $page_header_description !!} @endif
</div>
@if(is_tax())
<p class="breadcrumbs"><a href="{!! home_url('/') !!}">Home</a> / <a class="text-capitalize" href="{!! home_url() !!}/{!! $term->taxonomy !!}">{!! $term->taxonomy !!}</a> / <strong>{!! $term->name !!}</strong></p>
@else
@if ( function_exists('yoast_breadcrumb') )
{!! yoast_breadcrumb( '<p id="breadcrumbs" class="breadcrumbs">','</p>' ) !!}
@endif
@endif
</div>
</div>
</div>
</div>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment