]> _ Git - c6-wordpress.git/commitdiff
WIP #2684 @8
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 7 May 2019 18:40:04 +0000 (20:40 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 7 May 2019 18:40:04 +0000 (20:40 +0200)
wp-content/themes/c6/app/filters.php
wp-content/themes/c6/resources/assets/styles/common/debug.styl
wp-content/themes/c6/resources/assets/styles/components/buttons.styl
wp-content/themes/c6/resources/assets/styles/components/navigation.styl
wp-content/themes/c6/resources/assets/styles/layouts/header.styl
wp-content/themes/c6/resources/assets/styles/widgets/image-box.styl
wp-content/themes/c6/resources/views/template-custom.blade.php [deleted file]
wp-content/themes/c6/resources/views/template-redirect-to-first-child.php [new file with mode: 0644]

index 936c1a5fd9fb590934017cfbd5e2571c46372625..8509518764d7877b9398cbca220dabf2f7c9e279 100644 (file)
@@ -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;
+        }
+    }
+
+});
index a4e5895cb00ab4c95fcbc62c26208a672b047f82..e3362e8104e2ca06b3fd5e3611af7ffe104cc5d9 100644 (file)
@@ -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
index 8ef77b9e67d127624c784d289c8dd34777ec9aba..813b72d26a8930c2ecd12acbf0600e91fb75fa6b 100644 (file)
 .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
index 3d7ea12c8812f0cfc08e134ebac24bc46db8bcfe..944266f3accf2bd1590f1e315a078e1d017c6184 100644 (file)
@@ -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
     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
       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
index 7c874a4940da40513337007be633b219ade35af4..39be9d36d6093db9867b5c78f5309bc8e98af299 100644 (file)
@@ -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
index e3f06ab4f7759a52a12f30b79e13767592a4fc38..a52425738f7d0dc313d47e09bc934162373d17b0 100644 (file)
@@ -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 (file)
index 716b14a..0000000
+++ /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 (file)
index 0000000..3e4ad65
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Template Name: Redirect to first child
+ */
+
+// This template is for "holder" pages that have no content but contain sub-pages.
+// If the page is visited directly, it will redirect to the first child page (if possible).
+// The first child is not based on visual menu order, it is based on the "order" field in the page.
+
+// Since the HTTP headers are already sent when this code executes, we can't do the redirect here.
+// Instead, this template is used as a marker and we check the page template in the initialisation phase
+// and redirect from there...
+
+// See template_redirect action in theme's app/filters.php