I’ve injected all my pages into page.php in order to create dynamic scrollable static page with all pages content in one place. Therefore menu on the top should link to particular span id as delegate like https://domain.com/#page_name.
How can I change this code to obtain such feature?
]]><nav class=”navbar-collapse bs-navbar-collapse collapse” role=”navigation” id=”site-navigation”>
<?php _e( ‘Skip to content’, ‘zerif-lite’ ); ?>
<?php wp_nav_menu( array(
‘theme_location’ => ‘primary’,
‘container’ => false,
‘menu_class’ => ‘nav navbar-nav navbar-right responsive-nav main-nav-list’,
‘fallback_cb’ => ‘zerif_wp_page_menu’)); ?>
</nav></div>
1. Where is wp_page_menu located, and in the future what is a good way to search for something like this?
2. Since I currently am hosting my site on the Managed WordPress part of GoDaddy, which restricts the editing of core WordPress files, is the intended change even permissible on GoDaddy, or is there another way to suppress “Home”?
3. Apparently “Home” is inserted automatically if, like me, you have no Primary Menu–I want only Top Menus. But if I view All Pages from my Dashboard, I have no page called Home. For the same reason I see no way to modify Home, as by merging it with the static page that I would like to be my homescreen.
3. It would be good if WordPress gave us an idiot-proof means of renaming or hiding the Home menu.
]]>I’m trying to do something simply which is schedule a set of pages and subpages to appear on a fixed date e.g.
Topic Title (parent page)
– Subpage 1
– Subpage 2
When I schedule (or draft / private) the Topic Title (parent page) all child pages suddenly appear in the root main menu which is created using the wp_page_menu.
It seems that setting a parent page to draft / scheduled / private removes the parent from any child pages.
This is HUGELY annoying – is this a known bug? This feature is pretty standard across all other CMS tools (Yes I know its not strictly a CMS) but this quirk is stopping me from promoting WP as the ‘go to’ platform at my institution.
Any help / suggestions would be welcome
Alex Furr
]]>https://github.com/twittem/wp-bootstrap-navwalker
Everything works great except for the $fallback_cb
which is used by default when the theme is installed. I read in the codex that
$fallback_cb
(string) (optional) If the menu doesn’t exist, the fallback function to use. Set to false for no fallback. Note: Passes $args to the custom function.
The issue seems to be that the wp_page_menu function is not receiving the $args from the wp_nav_menu()
declaration.
Here is my current wp_nav_menu()
declaration.
<?php
wp_nav_menu( array(
'menu' => 'primary',
'theme_location' => 'primary',
'depth' => 2,
'container' => false,
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'wp_page_menu',
'walker' => new wp_bootstrap_navwalker())
);
?>
Can anyone offer some insight into how I might resolve this issue?
]]>I’m making this website for a friend of mine. And.. He wanted a menu-structure I really can’t make. I’ve tried with some regular expressions (preg_replace), but it wont work..
The structure I want is:
Parent page 1
– Parent page 1
– child page 1
– child page 2
– child page 3
Parent page 2
– Parent page 2
– child page 1
– child page 2
And I’m using the wp_page_menu() function to output the menu.
How to do this? I’ve tried changing the output with preg_replace, but maybe I’m just too stupid..
]]>wp_page_menu
. I fill the $args
with an array and in the array I set:
show_home => 1
It doesn’t show the home link. Because the function refference says that the ‘show home’ has a boolean values so I put 1 in it. Do I use the code right? Or is there something that I miss?
Oh, here’s the full array:
array
(
'show_home' => 1,
'link_before' => '<span>',
'link_after' => '</span>',
'sort_column' => 'menu_order',
'menu_class' => 'bot_menu_list'
)
]]>I have wordpress seo by Yoast activated, so I would like to deactivate all-in-one-seo but unless i keep it activated, i loose the functionality of my menu!
What is going on? Can I fix it? My site is www.properties247.co.uk
]]><?php wp_page_menu( 'sort_column=menu_order' ); ?>
code, the browser returns <div class="menu"><ul><li class="page_item page-item-711 current_page_item"><a href="https://localhost/wordpress/" title="Home">Home</a></li><li class="page_item page-item-713"><a href="https://localhost/wordpress/?page_id=713" title="Blog">Blog</a></li><li class="page_item page-item-707"><a href="https://localhost/wordpress/?page_id=707" title="About">About</a></li><li class="page_item page-item-23"><a href="https://localhost/wordpress/?page_id=23" title="Contact Us">Contact Us</a></li></ul></div>
I’m wondering if I can define my own class name instead of the long page_item page-item-713
that it gives each li.
Thanks!
]]>They used to work fine together, with WP-dTree overwriting ‘exclude pages’ settings – this was great for having 4 page links in top navigation, and 9 page links in left hand nav.
The plug-ins got upgraded and now I can only get both top and left to have 9 page links, or, by disabling ‘exclude pages’ I get 4 top and left – either way it doesn’t look good.
I think I could bypass the “exclude pages” plugin altogether by changing the following header code:
<?php
wp_page_menu('show_home=0&sort_column=menu_order, post_title&link_before=<span><span>&link_after=</span></span>');
Anyone any ideas how to change this to have 4 static page links?
thanks.
]]>