소스 검색

Fixed nav on non-front-page

Moritz Schmidt 3 년 전
부모
커밋
1458db9d96
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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 = '';