You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,19 +226,32 @@ If the `<body>` element has been assigned a height of `100%`, Smooth Scroll is u
226
226
227
227
228
228
229
-
## Adding `[data-scroll]` attributes to the `wp_nav_menu()` in WordPress
229
+
## Programatically adding `[data-scroll]` attributes to all anchor links
230
230
231
-
Add this to your `functions.php` file:
231
+
Useful if you have anchor links scattered throughout a page, or if you're using WordPress's `wp_nav_menu()` function. Add this code to your JavaScript:
232
232
233
233
```js
234
-
function YOURPREFIX_custom_nav_attributes ( $atts, $item, $args ) {
0 commit comments