current_page_item and custom post type?
You should use wordpress’s built in menu manager for this, along with a specific template file for listing the custom post types (for instance template-literature.php).
You should use wordpress’s built in menu manager for this, along with a specific template file for listing the custom post types (for instance template-literature.php).
Took a decent amount of tinkering, but I came up with something workable based around absolute positioning, I did not apply any hover actions, those should be relatively easy for you to do (don’t forget to z-index). Here’s the CSS I would use: #m { list-style: none; } #m > li { padding: 15px; float: … Read more
There are a few ways to have images as them menu links. Since you already have the wp_nav feature I’d suggest using it to add your images. Here is a quick way to do it: Step One Add a new custom nav menu: Step 2 Add a temporary page and upload the image for the … Read more
I solved this by using get_posts(). Credit goes to Reddit user milomilo.
Use the wordpress Menus under Appereance -> Menu and wp_nav_menu instead of wp_list_pages in your theme. If your theme is recent, changes are that you are using it now. Under Appereance -> Menu Create a menu, label il “Site menu” Create a custom link About, and assign it # as destination link Drag and drop … Read more
This is a core function in wp-admin/includes/nav-menu.php. You can either hide the items with CSS or use the myEASYhider plugin here. IIRC, in order to actually override core functions, it must be done from a plugin rather than functions.php, so either way you’ll be using a plugin that could potentially be turned off by the … Read more
Check the page’s source via your browser. And see if the links have a different “href=xxx” URL from the anchor text. It’s the only explanation unless your pages also have JS that rewrites the URLs on load or in the onclick event.
You can check if user logged in by calling is_user_logged_in function. Modify your menu rendering call like this: <?php if ( is_user_logged_id() ) : ?> <!– above html related to menu is going here –> <?php // wp_nav_menu call … ?> <!– below html related to menu is going here –> <?php endif; ?>
Register your menus in functions.php like so: if ( function_exists( ‘register_nav_menus’ ) ) { register_nav_menus( array( ‘my_main_menu’ => ‘Main Menu: description’, ‘my_sub_menu’ => ‘Sub Menu: description’, ‘my_footer_menu’ => ‘Footer Menu: description’ ) ); } Add the menu to the template like so: <?php wp_nav_menu( array( ‘sort_column’ => ‘menu_order’, ‘theme_location’ => ‘my_main_menu’, ‘container_class’ => ‘main-menu’ ) … Read more
Try this instead: wp_nav_menu( array(‘menu’ => ‘Main menu’ )); Make sure you have a menu called ‘Main menu’