functions2.php

<?php add_filter('wp_nav_menu_items','add_custom_in_menu', 10, 2); function add_custom_in_menu( $items, $args ) { // Don't forget to chnage "primary-menu" to the ID of your navigation menu if( $args->theme_location == 'primary-menu') { $items .= '<li>' . random_post() . '</li>'; } return $items; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.