[wp-trac] [WordPress Trac] #60211: [BUG] Custom Links in Menus with #targets FAIL TO WORK (just scroll to target)
WordPress Trac
noreply at wordpress.org
Sat Apr 13 01:51:00 UTC 2024
#60211: [BUG] Custom Links in Menus with #targets FAIL TO WORK (just scroll to
target)
--------------------------+------------------------------
Reporter: dbareis | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 6.4.2
Severity: major | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by jazzbee):
The issue you are experiencing with custom links in menus not working
correctly to navigate to specific sections (anchors) on your website can
be attributed to how the URLs are being handled by the browser when
clicked from different pages. Specifically, when clicking on a custom link
that includes a hash (#) target from a page with query parameters, the
browser might not interpret the link as intended due to how it resolves
the URL.
To resolve this issue, you can modify the custom links in your menu to
ensure they work consistently across different pages on your website. Here
are steps you can follow:
**Use Absolute URLs for Menu Links:
**Instead of using relative URLs or URLs with query parameters, use
absolute URLs for your custom menu links. This means specifying the full
URL including the domain name and path to the target page. For example:
{{{
http://example.com/search-
plants?category%5B%5D=Bird+Attracting#ShowMatchingPlants
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60211#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list