“Automatically add new top-level pages” Default

<?php add_action( ‘wp_create_nav_menu’, ‘PREFIX_nav_menu_auto_add_by_default’ ); function PREFIX_nav_menu_auto_add_by_default( $id ) { $options = (array) get_option( ‘nav_menu_options’ ); if ( ! isset( $options[‘auto_add’] ) ) { $options[‘auto_add’] = array(); } $options[‘auto_add’][] = $id; update_option( ‘nav_menu_options’, $options ); }

start_lvl on Walker is not working

Your menu doesn’t appear to have any levels. start_lvl and end_lvl are used for the sub-menu wrappers. The outer wrapper for the menu, the <ul> is defined by the items_wrap argument of wp_nav_menu(): wp_nav_menu( [ ‘walker’ => new My_Walker(), ‘items_wrap’ => ‘<nav id=”%1$s” class=”%2$s”>%3$s</nav>’, ] );

container_class doesn’t seem to be working

By default the wp_nav_menu() function generates HTML with both a container and UL menu. It will, by default, output some HTML structure that looks like this: <div id=”container_id” class=”container_class”> <ul id=”menu_id” class=”menu_class”> <li>…</li> </ul> </div> Since you have defined the container as a ul, WordPress will try to keep the some valid HTML standards by … Read more

Get last modified date for menu link

The nav_menu_link_attributes filter can be used to accomplish this, so a walker is not necessary. Here’s an example with comments along the way to explain what’s happening. add_filter( ‘nav_menu_link_attributes’, ‘wpse_nav_menu_link_attributes’, 10, 4 ); /** * Filters the HTML attributes applied to a menu item’s anchor element. * * Adds data-modified attribute to links. * – … Read more

Placing widget to menu

you can register a new sidebar, add it to the menu area and then add a widget to it: you can register a sidebar by adding this function to your functions.php: register_sidebar( array( ‘name’ => __( ‘Site Stat Widget’), ‘id’ => ‘stat-widget’, ‘description’ => __( ‘The Site Stat Widget’), ‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’, … Read more

How to implement my own icons instead of using the svg icon system

You could replace the function that is getting the svg image like so: <nav class=”social-navigation” role=”navigation” aria-label=”<?php esc_attr_e( ‘Footer Social Links Menu’, ‘twentyseventeen’ ); ?>”> <?php wp_nav_menu( array( ‘theme_location’ => ‘social’, ‘menu_class’ => ‘social-links-menu’, ‘depth’ => 1, ‘link_before’ => ‘<span class=”screen-reader-text”>’, ‘link_after’ => ‘</span><img src=”‘.get_home_url().’/path/to/image.png”>’, ) ); ?> </nav><!– .social-navigation –>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)