From: Stephen Cameron Date: Tue, 7 May 2019 18:40:04 +0000 (+0200) Subject: WIP #2684 @8 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b462e06c4a2fc855f0a75de98e9fd364118c41e6;p=c6-wordpress.git WIP #2684 @8 --- diff --git a/wp-content/themes/c6/app/filters.php b/wp-content/themes/c6/app/filters.php index 936c1a5..8509518 100644 --- a/wp-content/themes/c6/app/filters.php +++ b/wp-content/themes/c6/app/filters.php @@ -89,3 +89,24 @@ add_filter('comments_template', function ($comments_template) { return $comments_template; }, 100); + + +/** + * Handle redirection to first child page when template is set to 'template-redirect-to-first-child.php' + * (see template file for more details on why this has to be done here) + */ +add_action('template_redirect', function () { + + $pageID = get_the_ID(); + + if (get_page_template_slug($pageID) == 'views/template-redirect-to-first-child.php') { + + $children = get_pages("child_of={$pageID}&sort_column=menu_order"); + + if (is_array($children)) { + wp_safe_redirect(get_permalink($children[0]->ID)); + exit; + } + } + +}); diff --git a/wp-content/themes/c6/resources/assets/styles/common/debug.styl b/wp-content/themes/c6/resources/assets/styles/common/debug.styl index a4e5895..e3362e8 100644 --- a/wp-content/themes/c6/resources/assets/styles/common/debug.styl +++ b/wp-content/themes/c6/resources/assets/styles/common/debug.styl @@ -16,7 +16,7 @@ if ($debug) lost-utility: overlay $content-max-width 1 10px #ccc; body - lost-utility: overlay 960px 1 2px rgba(#fc0, 0.7); + lost-utility: overlay 1536px 1 2px rgba(#fc0, 0.7); // Centre line &:after diff --git a/wp-content/themes/c6/resources/assets/styles/components/buttons.styl b/wp-content/themes/c6/resources/assets/styles/components/buttons.styl index 8ef77b9..813b72d 100644 --- a/wp-content/themes/c6/resources/assets/styles/components/buttons.styl +++ b/wp-content/themes/c6/resources/assets/styles/components/buttons.styl @@ -16,6 +16,14 @@ .elementor-button.elementor-size-xl background-color: $colors.orange border-radius: 999px - padding: 1em 2em + padding: 2em 5em text-align: center - font-size: 1em + font-smoothing() + font-size: 12px + font-weight: 800 + text-transform: uppercase + transition: all 0.3s ease-out + + &:hover + transform: scale(1.1) + opacity: 0.9 diff --git a/wp-content/themes/c6/resources/assets/styles/components/navigation.styl b/wp-content/themes/c6/resources/assets/styles/components/navigation.styl index 3d7ea12..944266f 100644 --- a/wp-content/themes/c6/resources/assets/styles/components/navigation.styl +++ b/wp-content/themes/c6/resources/assets/styles/components/navigation.styl @@ -32,9 +32,6 @@ &:hover color: $colors.orange - // Special CTA button - .button a:hover - color: #fff .current_page_item, .current-menu-parent border-bottom: 2px solid $colors.orange @@ -47,15 +44,14 @@ left: 0 top: 100% white-space: normal - padding: 0 z-index: 50 - background: #1c1c1c text-align: left text-transform: none font-weight: normal transition: opacity 0.3s font-family: $font - padding: 5px 0 + padding: 0 + border-top: 2px solid $colors.orange .current_page_item border-bottom: none @@ -65,20 +61,25 @@ display: block width: 100% padding-bottom: 0 - padding-right: 1em margin: 0 a font-smoothing-reset() display: block margin: 0 - padding: 8px 15px + padding: 0.5em 1em border: 0 letter-spacing: normal - color: #fff + color: $colors.orange + background: #fff + + .hero-header & + background: #000 + color: #fff &:hover - color: $colors.orange + color: #fff + background: $colors.orange ul.nav diff --git a/wp-content/themes/c6/resources/assets/styles/layouts/header.styl b/wp-content/themes/c6/resources/assets/styles/layouts/header.styl index 7c874a4..39be9d3 100644 --- a/wp-content/themes/c6/resources/assets/styles/layouts/header.styl +++ b/wp-content/themes/c6/resources/assets/styles/layouts/header.styl @@ -79,14 +79,28 @@ header.site &-list display: none position: absolute - left: 0 + left: -1em top: 100% reset-list() line-height: 1.8 + li + padding: 0.3em 1em + background-color: #fff + color: $colors.orange + + .hero-header & + background-color: #000 + color: #fff + + &:hover + background-color: $colors.orange + color: #fff + // Current active locale in submenu &-active font-weight: 700 + cursor: default // Burger menu icon .menu-opener diff --git a/wp-content/themes/c6/resources/assets/styles/widgets/image-box.styl b/wp-content/themes/c6/resources/assets/styles/widgets/image-box.styl index e3f06ab..a524257 100644 --- a/wp-content/themes/c6/resources/assets/styles/widgets/image-box.styl +++ b/wp-content/themes/c6/resources/assets/styles/widgets/image-box.styl @@ -11,3 +11,4 @@ &-description font-size: 16px + max-width: 325px diff --git a/wp-content/themes/c6/resources/views/template-custom.blade.php b/wp-content/themes/c6/resources/views/template-custom.blade.php deleted file mode 100644 index 716b14a..0000000 --- a/wp-content/themes/c6/resources/views/template-custom.blade.php +++ /dev/null @@ -1,12 +0,0 @@ -{{-- - Template Name: Custom Template ---}} - -@extends('layouts.app') - -@section('content') - @while(have_posts()) @php the_post() @endphp - @include('partials.page-header') - @include('partials.content-page') - @endwhile -@endsection diff --git a/wp-content/themes/c6/resources/views/template-redirect-to-first-child.php b/wp-content/themes/c6/resources/views/template-redirect-to-first-child.php new file mode 100644 index 0000000..3e4ad65 --- /dev/null +++ b/wp-content/themes/c6/resources/views/template-redirect-to-first-child.php @@ -0,0 +1,14 @@ +