Need help with adding custom wordpress menu and sub-menu

Use this code bellow to dynamic you nav: <?php $args = array( ‘theme_location’ => ”, ‘menu’ => ‘Main’, ‘container’ => ‘false’, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ‘cs-main-navigation cs-clearfix’, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, ‘after’ => ”, ‘link_before’ => ”, ‘link_after’ => ”, ‘items_wrap’ => ‘<ul … Read more

How can I create this menu with wp_nav_menu()?

This can achieve with a nav walker. I used this. I am stepping according to the mentioned. Put navwalker (wp-bootstrap-navwalker.php) in your theme root Call to the navwalker in functions.php file. require_once(‘wp-bootstrap-navwalker.php’); Create your menu in WordPress Backend (Appearance -> Menus) In your menu area, according to me in header.php wp_nav_menu( array( ‘menu’ => ‘main_menu’, … Read more

display cart information within li of cart menu item

The items in the $fragments array will replace the html contents of the element you specify as the key. In your example $fragments[‘li.menu-item-type-woocommerce-cart’] = ‘some html’; some html will be inserted in the DOM element <li class=”menu-item-type-woocommerce-cart”> Here is the Javascript: $( ‘li.menu-item-type-woocommerce-cart’ ).replaceWith( ‘some html’ ); Is there already such an element in your … Read more

Sub-Items Not Visible in Navigation

I assume that you didn’t change the theme to something else, then change it back to the original theme? In any case, look at Appearance, Menu to see if your menu is set up as you wish it to be. Then check to ensure that the menu is selected to be used by your theme.

Insert a hash into the url of custom posts to make them function as anchors

I have come up with a solution. First I have assigned a slug to the custom post type: $rewrite = array( ‘slug’ => ‘something’, ‘with_front’ => false, ‘pages’ => false, ‘feeds’ => false, ); The I use a filter and a regex. function 1234_filter_custom_post_url( $url, $post ) { if ( ‘my_custom_post_type’ == get_post_type( $post ) … Read more