Jelajahi Sumber

FIX #1449: Solve primary menu display issue

Niels Lange 5 tahun lalu
induk
melakukan
87092e0695
4 mengubah file dengan 48 tambahan dan 0 penghapusan
  1. 14 0
      shawburn/functions.php
  2. 14 0
      shawburn/sass/_extra-child-theme.scss
  3. 10 0
      shawburn/style-rtl.css
  4. 10 0
      shawburn/style.css

+ 14 - 0
shawburn/functions.php

@@ -181,3 +181,17 @@ function shawburn_editor_styles() {
 	wp_enqueue_style( 'shawburn-editor-fonts', shawburn_fonts_url(), array(), null );
 }
 add_action( 'enqueue_block_editor_assets', 'shawburn_editor_styles' );
+
+/**
+ * Add custom body classes.
+ *
+ * @param array $classes The existing body classes.
+ * @return array $classes The updated body classes.
+ */
+function shawburn_body_classes( $classes ) {
+	if ( ! has_nav_menu( 'social' ) ) {
+		$classes[] = 'has-no-social-menu';
+	}
+	return $classes;
+}
+add_filter( 'body_class', 'shawburn_body_classes' );

+ 14 - 0
shawburn/sass/_extra-child-theme.scss

@@ -22,6 +22,20 @@ body {
 	}
 }
 
+.home.has-no-social-menu.hide-homepage-title {
+	.hentry .entry-content {
+		& > *:first-child {
+			&.alignfull {
+				margin-top: -#{1 * map-deep-get($config-global, "spacing", "unit")};
+
+				@include media(mobile) {
+					margin-top: -#{2 * map-deep-get($config-global, "spacing", "unit")};
+				}
+			}
+		}
+	}
+}
+
 a {
 	text-decoration: none;
 }

+ 10 - 0
shawburn/style-rtl.css

@@ -3416,6 +3416,16 @@ body {
 	}
 }
 
+.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
+	margin-top: -16px;
+}
+
+@media only screen and (min-width: 560px) {
+	.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
+		margin-top: -32px;
+	}
+}
+
 a {
 	text-decoration: none;
 }

+ 10 - 0
shawburn/style.css

@@ -3445,6 +3445,16 @@ body {
 	}
 }
 
+.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
+	margin-top: -16px;
+}
+
+@media only screen and (min-width: 560px) {
+	.home.has-no-social-menu.hide-homepage-title .hentry .entry-content > *:first-child.alignfull {
+		margin-top: -32px;
+	}
+}
+
 a {
 	text-decoration: none;
 }