Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I need this modification, too. I have categories with multiple posts, but I want the main menu item to just go to the first post in that category. I also want the other posts to show up as sub menus.

    The code that swinggraphics posted works beautifully. However, if you ever release an update, the change is lost, the menu no longer works right, and I have confused or angry customers. If you do have some time to add the code and update on your end, it would be greatly appreciated.

    Thread Starter rgbcraft

    (@rgbcraft)

    Thank you so much!

    Thread Starter rgbcraft

    (@rgbcraft)

    I may have the wrong place, but I tried your suggestion and the menu disappeared altogether.

    /*
    	* Build the menu structure for display: Augment taxonomies (category, tags or custom taxonomies) that have been marked as such, by their posts. Optionally: remove original menu item.
    	*/
    	function cpcm_replace_taxonomy_by_posts( $sorted_menu_items, $args ) {
    		$result = array();
    		$inc = 0;
    
    		foreach ( (array) $sorted_menu_items as $key => $menu_item ) {
    		if ( is_sticky()) {continue ;}
    			// Augment taxonomy object with a list of its posts: Append posts to $result
    			// Optional: Remove the taxonomy object/original menu item itself.
Viewing 3 replies - 1 through 3 (of 3 total)