Any reason why widgets/menus get emptied when I updated custom theme code?
Any reason why widgets/menus get emptied when I updated custom theme code?
Any reason why widgets/menus get emptied when I updated custom theme code?
you should try that with a custom Nav Walker. Here is a code example how it should work. I check if the menu item is a category link. If yes, there is another check -> category count.If the category don’t have any posts the link won’t be passed to the html output. class Menu_Category_Count extends … Read more
Backend – Categories and Menus conflicts
If I got you correct, You would like to know about where Top primary menu is written. So answer is simple, it is the part of the back end.You need to login to your admin dashboard. After login , Go to Appearance > Menus. When you go here, you will find below screen: In above … Read more
For the ul part you should use this: ‘items_wrap’ => ‘<ul id=”%1$s” class=”%2$s”>%3$s</ul>’, %3$s is a placeholder for the list items, so you shouldn’t change it to “Laptop” as you have done. These are the parameters for the id and the class, that need to go together with items_wrap: ‘menu_class’ => ‘menu_123’, ‘menu_id’ => ‘mno’, … Read more
You can create a menu item for search icon/button and check it’s ID in HTML code. Then use can use jQuery click function to show and hide search div. For example if my menu item list (li) id is menu-item-22 and search form container class is search_div then this will be the jQuery for displaying/hiding … Read more
I did a similar thing in many of my projects, here’s how I did it: <div class=”user-panel”> <ul> <?php if (is_user_logged_in() ) { // When the user is Logged-in $current_user= wp_get_current_user(); echo ‘<li>’. __( ‘Welcome, ‘, ‘text-domain’ ) .'<strong>’. $current_user->user_nicename .'</strong></li>’; echo ‘<li><a href=”‘. wp_logout_url( home_url() ) .'” title=”Log out”>’. __( ‘Log out’, ‘text-domain’ ) … Read more
This sounds suspiciously like the conflict that happens sometimes when tag taxonomies, custom post types, and menus collide in a weird way. I have only found hacks for this issue, and many of them are listed in this thread on WordPress.org.
add current-menu-item to multiple custom post types
If you want to do something like a “Back to previous page”-link that will probably not work with the WP menu system. But you could modify/add your theme and use $_SERVER[‘HTTP_REFERER’] (PHP manual) to link back to the site, where the user clicked the link to the actual page. But that information can also be … Read more