Explorar o código

Fixed nav on non-front-page

Moritz Schmidt %!s(int64=3) %!d(string=hai) anos
pai
achega
1458db9d96
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      dist/wp_bootstrap_navwalker.php

+ 2 - 2
dist/wp_bootstrap_navwalker.php

@@ -101,8 +101,8 @@ class wp_bootstrap_navwalker extends Walker_Nav_Menu {
 			$atts['class'] = "nav-link scroll-link"; // MY EDIT
 			$atts['data-target'] = ltrim($atts['href'], '/');
 			$atts['href'] = ltrim($atts['href'], '/');
-			if(is_front_page() && (in_category("Startseite", $postID))) {
-				$atts['href'] = "#post-" . $postID . "-jumper";
+          	if(in_category("Startseite", $postID)) {
+				$atts['href'] = is_front_page() ? "#post-" . $postID . "-jumper" : "/#post-" . $postID . "-jumper";
 			}
 
 			$attributes = '';