Moritz Schmidt 9 năm trước cách đây
mục cha
commit
58a2c513f8
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      dist/wp_bootstrap_navwalker.php

+ 4 - 2
dist/wp_bootstrap_navwalker.php

@@ -96,11 +96,13 @@ class wp_bootstrap_navwalker extends Walker_Nav_Menu {
 
 			$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
 
+			$postID = get_post_meta( $item->ID, '_menu_item_object_id', true );
+
 			$atts['class'] = "nav-link scroll-link"; // MY EDIT
 			$atts['data-target'] = ltrim($atts['href'], '/');
 			$atts['href'] = ltrim($atts['href'], '/');
-			if(!is_front_page() && (strpos($atts['href'], 'http') !== 0)) {
-				$atts['href'] = "/index.php" . $atts['href'];
+			if(is_front_page() && (in_category("Startseite", $postID))) {
+				$atts['href'] = "#post-" . $postID . "-jumper";
 			}
 
 			$attributes = '';