Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 11
Impact
~14k people reached

  • 0 posts edited
  • 0 helpful flags
  • 4 votes cast
Nov
22
comment How to replace the page url for the page slug in a menu link?
In addition, I notice that there are only eight entries of $item are printed on the page. In total I have 14 menu items / pages
Nov
22
comment How to replace the page url for the page slug in a menu link?
Almost there. You're thought is clear, but it will still not exclude the section with the template 'ads' from the menu... When I tried to print_r( $template ); There is nothing that will be outputted.
Nov
21
comment How to replace the page url for the page slug in a menu link?
I have added the ad page to the menu via Appearance > Menus. And select the ads template in the page editor. Still the adv will appears in the menu. Adv template: snippi.com/s/xybpeew Saved in the folder templates/ads.php. Menu function that I used is the same as I mentioned in my question above. To change the URL to #slug is working great! Hope the new code we also get to work!
Nov
21
comment How to replace the page url for the page slug in a menu link?
Thank you for your updated answer. I will go test it out and let you know if it is working correct!
Nov
21
revised How to replace the page url for the page slug in a menu link?
Extend my question
Nov
21
comment How to replace the page url for the page slug in a menu link?
My apologize for that it is not entirely clear, I've updated my question. Sounds at least promising. Would be very nice if you have an answer to this question!
Nov
21
revised How to replace the page url for the page slug in a menu link?
Extend my question
Nov
21
comment How to replace the page url for the page slug in a menu link?
Hmm, I ask this because I am stuck with the following: I create a single page site. In index.php I loop through all pages within WordPress and add them to the index file - front page with a custom loop. What I want is that the menu order determine on which position each section (page) should be placed. I use the menu_order to order the sections. But there are some sections that are using a custom template. These sections should not appear in the menu as a link, only as the page. And the links should be replaced with #slug. Do you have any ideas how to achieve this. It would help me so much.
Nov
21
comment How to replace the page url for the page slug in a menu link?
Thank you JHoffmann, is this also possible with wp_page_menu? Because I also need this for wp_page_menu . If you have also an code for that, it would be absolute great. I am very greatful!
Nov
21
asked How to replace the page url for the page slug in a menu link?
Nov
20
comment How to exclude pages in the menu without pageID?
Still get stuck with the wp_nav_menu_items. If you have some time to help me out, would be absolute great.
Nov
19
accepted How to exclude pages in the menu without pageID?
Nov
19
comment How to exclude pages in the menu without pageID?
Okay, no problem. I will looking for it on the internet. Thank you for your time and help!
Nov
19
asked How to create a custom walker class to replace the href with hashtag slug?
Nov
19
comment How to exclude pages in the menu without pageID?
Is there a possibility to make an example of the wp_nav_menu_items , like the previous ones. You would help me immensely and that's really where I have been looking for.
Nov
19
comment How to exclude pages in the menu without pageID?
Thank you Milo. This is working, only how is the order of the menu items determined? Because the order of how I position the items in Appearance > Menu is not the same.. Is there also a way to exclude it for wp_nav_menu so the customer can manage the order of the sections with the Menu order?
Nov
19
revised How to exclude pages in the menu without pageID?
added 879 characters in body
Nov
19
comment How to exclude pages in the menu without pageID?
Yes, but your arg array should be added to the page loop, am I right? And parallax.php is saved in a folder templates.
Nov
19
comment How to exclude pages in the menu without pageID?
Hmm this is not working as expect, because this array of arguments is used for the loop to walk through al pages. That is working correct, only what I want is to doesn't show the sections inside the menu.
Nov
19
comment How to exclude pages in the menu without pageID?
Thank you for your answer. This looks like to work, but the only thing is that this will work for which page is showed, am I right? What I am searching for is, the way to exclude only the menu item in the menu if the item has the page template parallax, but it should still display the page. So all pages should be visible, only the ones with a custom template parallax should not appears in the menu item list.