You can add a filter to page_link
to modify link output:
function wpd_add_fragment_to_pages( $url ) {
return $url . '#navbar';
}
add_filter( 'page_link', 'wpd_add_fragment_to_pages' );
Related Posts:
- Which settings/options are saved on a theme-basis and how does this affect theme-switching?
- Add Class to Custom Menu Widget ul
- Dynamically exclude menu items from wp_nav_menu
- Add a custom walker to a menu created in a widget
- Add custom menu item using wp_nav_menu_items filter
- Custom search filter causes menu and query_posts problems
- Unregister Nav Menu from Child-Theme
- Assign Menus to Theme Locations with theme activation
- Allow html tags in WordPress Custom Menus Description Field
- Using filters to change href of nav menu page link
- How to register custom menu widget
- How to apply a class to the second word in menu list item?
- WordPress nav_menu_link_attributes Not Working
- Is it possible to add a filter for the output of nav-menu items in admin?
- if role is logged in then do something
- Override custom menu widget
- Filter menu item to add classes/attributes?
- Edit html for menu items in default frontend menu
- Add custom SVG icons to Social Icon MENU in WordPress Twenty Seventeen Child Theme
- Placing widget to menu
- Set Item Order with wp_nav_menu_{$menu->slug}_items
- How do I create a magazine type menu – sub-menu setup using wp_nav_menu and child of twentyten? [closed]
- When at / ( or “home”) my menu doesn’t get a current-menu-item class
- How to add parent element’s title to nav menu’s child?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- Add class to active element and its parent in nav menu
- Make compatible custom menu widget for Twitter Bootstrap
- WordPress Custom Menu Widget Style
- Indirect modification of overloaded property WP_Post::$classes has no effect
- display only the wp_nav_menu, which has the current-menu-item
- Change HTML structure for custom menu in sidebar
- TwentyTwelve child theme mobile menu not working
- Removing strip_tags not working on nav_menu_description
- How to add a tag to wp_nav_menu in a child theme
- Third level navigation class
- How to give custom classes to the WordPress Menu widget
- Prev / Next menu item
- How to add class to and childs of sidebar widget – WordPress
- add span to top level links of a wordpress menu called “main”
- Menu item added in wp_nav_menu_items filter is never highlighted
- Debugging – trying to add search box to menus
- wp_list_pages() but only show children on the branch you are on
- From a page, is it possible to find entry’s “menu_item_parent”?
- Add active class to top-level menu items when viewing single for that post type
- add_filter on menu items to add a menu item
- Replace a menu with widget or a custom template file programmatically
- how to disable default menu classes
- Insert other menus as submenus of a main menu
- list category posts under its item in menu
- Prevent menu from loading in a page template [duplicate]
- Insert a div before the wp_nav_menu
- How to change menu structure?
- Secondary Navigation Menudisappeared When using wp_nav_menu_items
- remove specific classes from menu items
- How to create and populate with few links a menu in child theme functions.php?
- wp_nav_menu action/filter help
- add_filter for where statment issue
- Recent Posts widget missing current_menu_item class
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- Add a counter beside menu item label
- How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)
- Add custom link on the fly to nav menu
- menu-item class missing on wordpress menu
- Filter to hook into menu items and add a custom attribute
- How to avoid the and which added when custon menu widget is used
- “Widgets” menu doesn’t appear
- Switching to child theme breaks menu names
- Simple form to add custom links to menu?
- How to add social buttons like facebook and twitter in the footer of a theme?
- Catagorized hierarchy menu for PAGES!
- if role is logged in then do something
- Possible to append class to nav menu added to widget area?
- Is there any difference between widgets (used in order to manage menus) and register_nav_menus() in terms of performance?
- twentysixteen child theme – responsive menu – ham icon button not working – Cannot read property ‘classList’ of null
- How to work with a custom theme that someone else created before me? (details below)
- Adding widget to sidebar which contains current page’s submenu
- How to point menu to my homepage
- Modifying Woocommerce menu based on tags and categories
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- Menu location switcher – example code fails
- Add Featured Image and Title to wp_nav_menu items
- Show thumbnail to category items in wp_nav_menu(), how?
- How to add a toggle on the left side of my page?
- Avoid changing menu query with suppress_filters => false
- Menu on responsive twentytwelve theme not working, strange url error
- Any reason why widgets/menus get emptied when I updated custom theme code?
- Removing menu item doesn’t get removed on edit post
- Theme: Twenty Thirteen Mobile Sliding Menu Doesn’t Bump Content Down
- Add Protocol to Custom Menus
- How to modify menu text in callback function of ‘walker_nav_menu_start_el’ hook
- Why is WordPress stripping anchor links from mneu item URLs?
- Twenty-Twenty-Two Child Theme Mega Menu
- Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles
- Add button and title on submenu WordPress
- Partial refresh of menu in customizer not working?
- How to add new sidebar widget area to child theme?
- next_post_link() on custom menu structure
- How to show dynamic side bar on menu item [closed]
- add_menu_page does not render the expected result
- Custom widget breaking widget section in admin menu