From: stephen@cubedesigners.com Date: Wed, 13 Jun 2018 15:27:26 +0000 (+0000) Subject: Custom 404 pages + hero block responsive adjustments. WIP #1912 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dbe301e71abd127d0f5aabde31ea4e2097f1a45b;p=physioassist-wordpress.git Custom 404 pages + hero block responsive adjustments. WIP #1912 @0.5 --- diff --git a/wp-content/themes/physioassist/app/setup.php b/wp-content/themes/physioassist/app/setup.php index 9f383e6b..173522d9 100644 --- a/wp-content/themes/physioassist/app/setup.php +++ b/wp-content/themes/physioassist/app/setup.php @@ -11,7 +11,9 @@ use Roots\Sage\Template\BladeProvider; * Theme assets */ add_action('wp_enqueue_scripts', function () { - wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), false, null); + // NOTE: 'elementor-frontend' is added as a dependency for the main stylesheet to ensure that our stylesheet + // is always loaded afterwards, allowing us to override the default styles. On 404 pages, this wasn't happening. + wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), ['elementor-frontend'], null); wp_enqueue_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, true); }, 100); diff --git a/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl b/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl index c6b6a55d..334a4a1a 100644 --- a/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl +++ b/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl @@ -29,7 +29,7 @@ $header-height = 84px // How much space to leave for transparent header +below($breakpoint-hero-block) position: static - padding: s('calc(%s + 4vw) 5vw 30px', $header-height) + padding: s('calc(%s + 2.5vw) 5vw 40px', $header-height) bottom: 0 right: 0 @@ -60,6 +60,8 @@ $header-height = 84px // How much space to leave for transparent header font-size: 44px margin-bottom: 0.5em + +below(700px) + font-size: 7vw !important +below(500px) br display: none @@ -69,7 +71,13 @@ $header-height = 84px // How much space to leave for transparent header font-weight: 500 line-height: 1.5 + +below(700px) + font-size: 16px !important + &-cta display: block color: #fff margin-top: 30px + + +below(700px) + margin-top: 1.5em diff --git a/wp-content/themes/physioassist/resources/views/404.blade.php b/wp-content/themes/physioassist/resources/views/404.blade.php index ee68d543..61e8753b 100644 --- a/wp-content/themes/physioassist/resources/views/404.blade.php +++ b/wp-content/themes/physioassist/resources/views/404.blade.php @@ -1,12 +1,15 @@ @extends('layouts.app') @section('content') - @include('partials.page-header') - - @if (!have_posts()) -
- {{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }} -
- {!! get_search_form(false) !!} - @endif + + @php + // Fetch content from page named '404-template' + // ToDo: make this more robust + $post = get_page_by_path('404-template'); + + if ($post) { + echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display(wpml_object_id_filter($post->ID, 'page', true)); + } + @endphp + @endsection