From cbd58fb8093c2b45137bed172430d0e3900990bc Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Thu, 27 May 2021 00:48:48 +0200 Subject: [PATCH] in center top menu added dropdown and tag cloud --- biofriction-theme/archive.php | 7 +++ biofriction-theme/functions.php | 1 + biofriction-theme/header-orig.php | 50 ---------------- biofriction-theme/header.php | 11 +++- ...-foundationpress-center-top-bar-walker.php | 20 +++++++ biofriction-theme/library/navigation.php | 21 +++++++ biofriction-theme/src/assets/scss/app.scss | 1 + .../src/assets/scss/components/_tags.scss | 15 +++++ .../src/assets/scss/modules/_header.scss | 12 ++++ .../src/assets/scss/modules/_navigation.scss | 57 ++++++++++++++++++- 10 files changed, 143 insertions(+), 52 deletions(-) delete mode 100644 biofriction-theme/header-orig.php create mode 100644 biofriction-theme/library/class-foundationpress-center-top-bar-walker.php create mode 100644 biofriction-theme/src/assets/scss/components/_tags.scss diff --git a/biofriction-theme/archive.php b/biofriction-theme/archive.php index 4449e8f..55e0ae3 100644 --- a/biofriction-theme/archive.php +++ b/biofriction-theme/archive.php @@ -26,6 +26,13 @@ get_header(); ?> + +
+ + + +
+
diff --git a/biofriction-theme/functions.php b/biofriction-theme/functions.php index 141eaff..f92de0e 100644 --- a/biofriction-theme/functions.php +++ b/biofriction-theme/functions.php @@ -27,6 +27,7 @@ require_once( 'library/class-foundationpress-comments.php' ); require_once( 'library/navigation.php' ); /** Add menu walkers for top-bar and off-canvas */ +require_once( 'library/class-foundationpress-center-top-bar-walker.php' ); require_once( 'library/class-foundationpress-top-bar-walker.php' ); require_once( 'library/class-foundationpress-mobile-walker.php' ); diff --git a/biofriction-theme/header-orig.php b/biofriction-theme/header-orig.php deleted file mode 100644 index 0f183cf..0000000 --- a/biofriction-theme/header-orig.php +++ /dev/null @@ -1,50 +0,0 @@ - - - > - - - - - - > - - - - - - diff --git a/biofriction-theme/header.php b/biofriction-theme/header.php index d3d275a..f165be0 100644 --- a/biofriction-theme/header.php +++ b/biofriction-theme/header.php @@ -25,7 +25,16 @@

- + + diff --git a/biofriction-theme/library/class-foundationpress-center-top-bar-walker.php b/biofriction-theme/library/class-foundationpress-center-top-bar-walker.php new file mode 100644 index 0000000..3e5bbdd --- /dev/null +++ b/biofriction-theme/library/class-foundationpress-center-top-bar-walker.php @@ -0,0 +1,20 @@ +\n"; + } + } +endif; diff --git a/biofriction-theme/library/navigation.php b/biofriction-theme/library/navigation.php index 520d96d..4c0c832 100644 --- a/biofriction-theme/library/navigation.php +++ b/biofriction-theme/library/navigation.php @@ -9,11 +9,32 @@ register_nav_menus( array( + 'top-bar-c' => esc_html__( 'Center Top Bar', 'foundationpress' ), 'top-bar-r' => esc_html__( 'Right Top Bar', 'foundationpress' ), 'mobile-nav' => esc_html__( 'Mobile', 'foundationpress' ), ) ); +/** + * Desktop navigation - center top bar + * + * @link http://codex.wordpress.org/Function_Reference/wp_nav_menu + */ +if ( ! function_exists( 'foundationpress_top_bar_c' ) ) { + function foundationpress_top_bar_c() { + wp_nav_menu( + array( + 'container' => false, + 'menu_class' => 'center dropdown menu menu desktop-menu', + 'items_wrap' => '', + 'theme_location' => 'top-bar-c', + 'depth' => 3, + 'fallback_cb' => false, + 'walker' => new Foundationpress_Center_Top_Bar_Walker(), + ) + ); + } +} /** * Desktop navigation - right top bar diff --git a/biofriction-theme/src/assets/scss/app.scss b/biofriction-theme/src/assets/scss/app.scss index 081ef66..a16dd2f 100644 --- a/biofriction-theme/src/assets/scss/app.scss +++ b/biofriction-theme/src/assets/scss/app.scss @@ -84,6 +84,7 @@ @import "components/formstype"; @import "components/gallery"; @import "components/links"; +@import "components/tags"; @import "components/wpcf7"; // contact form 7 overrides // Templates diff --git a/biofriction-theme/src/assets/scss/components/_tags.scss b/biofriction-theme/src/assets/scss/components/_tags.scss new file mode 100644 index 0000000..c110e65 --- /dev/null +++ b/biofriction-theme/src/assets/scss/components/_tags.scss @@ -0,0 +1,15 @@ +.bfr_category_tags { + .tag-cloud-link::before { + content: '#'; + display: inline-block; + } + a{ + padding:0; + margin:0 0.5rem; + &:hover { + color:$primary-color; + background-color:$secondary-color; + } + } +} + diff --git a/biofriction-theme/src/assets/scss/modules/_header.scss b/biofriction-theme/src/assets/scss/modules/_header.scss index 2a3737b..6532731 100644 --- a/biofriction-theme/src/assets/scss/modules/_header.scss +++ b/biofriction-theme/src/assets/scss/modules/_header.scss @@ -17,6 +17,18 @@ height: 10rem; background-image: url('../images/biofriction-logo-moving-trans-loosy-100.gif'); } + + .bfr_category_tags { + min-height: $global-margin * 6.5; + margin-bottom: -($global-margin * 6.5); + padding-top: $global-padding; + display:flex; + justify-content:center; + a { + display:inline-block; + margin-bottom: auto; + } + } } } } diff --git a/biofriction-theme/src/assets/scss/modules/_navigation.scss b/biofriction-theme/src/assets/scss/modules/_navigation.scss index fc95bb2..b5bff2f 100644 --- a/biofriction-theme/src/assets/scss/modules/_navigation.scss +++ b/biofriction-theme/src/assets/scss/modules/_navigation.scss @@ -15,6 +15,51 @@ } // Site top-navigation +.site-center-top-nav{ + font-family: $header-font-family; + .menu-item { + &:hover { + background-color: scale-color($secondary-color, $lightness: +20%) + } + border-radius: $button-radius; + } + .dropdown.menu > { + li { + margin: 0 $global-margin/2; + border-width: $global-padding/6; + border-style: solid; + border-color: $primary-color; + &.current-menu-item { + background: $primary-color; + a { + color: $secondary-color; + } + &:hover { + background: $secondary-color; + a { + color:$primary-color; + } + } + } + a { + padding: $global-padding*0.7 $global-padding*1 ; + color:$primary-color; + } + } + li.current-menu-item.is-active > a { +// color:$secondary-color; + } + li.is-dropdown-submenu-parent > a::after { + border-color: $primary-color transparent transparent; + } + } + .submenu { + background:none; + li { + background-color: $body-background; + } + } +} .site-top-widgets{ font-family: $header-font-family; .menu-item { @@ -31,7 +76,11 @@ &:hover { background: $secondary-color; } - // &.is-active, + &.is-active { + a { + color:$secondary-color; + } + } &.current-menu-item { border-color: $primary-color; background: $primary-color; @@ -48,6 +97,12 @@ } } } + .submenu { + background:none; + li { + background-color: $body-background; + } + } } .site-top-nav{ font-family: $header-font-family;