{"id":26,"date":"2019-09-21T03:43:20","date_gmt":"2019-09-21T03:43:20","guid":{"rendered":"https:\/\/www.loftocean.com\/eaven\/?p=26"},"modified":"2019-11-04T03:44:12","modified_gmt":"2019-11-04T03:44:12","slug":"how-to-display-posts-of-a-category-in-menu-mega-menu","status":"publish","type":"post","link":"https:\/\/www.loftocean.com\/eaven\/start\/how-to-display-posts-of-a-category-in-menu-mega-menu\/","title":{"rendered":"How to display posts of a category in menu (mega menu)"},"content":{"rendered":"<p>When previewing Eaven theme demo sites, you may see that when you hover the mouse over a menu item, a full-width drop-down menu with several posts appears. Like shown in this screenshot:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1.jpg\" alt=\"\" width=\"2000\" height=\"641\" class=\"aligncenter size-full wp-image-45\" srcset=\"https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1.jpg 2000w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1-300x96.jpg 300w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1-768x246.jpg 768w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1-1024x328.jpg 1024w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-1-1200x385.jpg 1200w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/p>\n<p>This is a navigation item that enables the <strong>Mega Menu<\/strong> effect.<\/p>\n<div class=\"info-box\">\n<p><strong>What is Mega Menu?<\/strong><\/p>\n<p>&#8220;A mega menu is typically defined as a drop down interface that is triggered by the user hovering over a link or defined area. This dropdown usually shows all options in one main, mega-panel and oftentimes groups related topics into categories.&#8221;<\/p>\n<p>In short, it is a full-width dropdown menu in a navigation bar.<\/p>\n<\/div>\n<hr \/>\n<p>In Eaven theme, the <strong>Primary Menu<\/strong> supports mega menu. And you can show 2 types of mega menus:<\/p>\n<ul>\n<li>Display at most 4 recent posts of a category. Or, if the category item is a parent category that has several sub categories, then in the mega menu it will display at most 3 recent posts of each (sub) category, and a list of sub categories.<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2.jpg\" alt=\"\" width=\"2000\" height=\"641\" class=\"alignnone size-full wp-image-46\" srcset=\"https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2.jpg 2000w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2-300x96.jpg 300w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2-768x246.jpg 768w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2-1024x328.jpg 1024w, https:\/\/www.loftocean.com\/eaven\/wp-content\/uploads\/sites\/10\/2019\/09\/mega-menu-2-1200x385.jpg 1200w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/li>\n<li>Display sub nav items in 5 columns.<\/li>\n<\/ul>\n<hr \/>\n<p><strong>Set up the mega menu:<\/strong><\/p>\n<ol>\n<li>Go to <strong>Appearance<\/strong> &gt; <strong>Menus<\/strong>, make sure you are editing the primary menu.<\/li>\n<li>Click on <strong>Screen Options<\/strong> button located on the top right corner.<\/li>\n<li>Tick the box of <strong>CSS Classes<\/strong>.<br \/>\n<img decoding=\"async\" class=\"alignnone size-loft_extra_large wp-image-219\" src=\"http:\/\/www.loftocean.com\/fallsky\/wp-content\/uploads\/sites\/8\/2018\/05\/menu-class-1440x775.jpg\" alt=\"\" width=\"1200\" height=\"646\" \/><\/li>\n<li>To display posts of a category in the menu, add a category into the menu.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-loft_extra_large wp-image-220\" src=\"http:\/\/www.loftocean.com\/fallsky\/wp-content\/uploads\/sites\/8\/2018\/05\/add-category-to-menu-1440x839.png\" alt=\"\" width=\"1200\" height=\"699\" \/><\/li>\n<li>Then click on the category item in the menu, enter <span class=\"highlighted\" style=\"color: #3366ff;\">mega-menu<\/span> into <strong>CSS Classes<\/strong> field.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-221\" src=\"http:\/\/www.loftocean.com\/fallsky\/wp-content\/uploads\/sites\/8\/2018\/05\/mega-menu-class.png\" alt=\"\" width=\"430\" height=\"297\" \/><\/li>\n<li>To display sub nav items in columns, just add items into the primary menu, drag and drop to create multi-level menus, then click on the parent item, enter <span class=\"highlighted\" style=\"color: #3366ff;\">mega-menu<\/span> into <strong>CSS Classes<\/strong> field.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-222\" src=\"http:\/\/www.loftocean.com\/fallsky\/wp-content\/uploads\/sites\/8\/2018\/05\/multi-level-mega-menu.png\" alt=\"\" width=\"525\" height=\"559\" \/><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>When previewing Eaven theme demo sites, you may see that when you hover the mouse over a menu item, a full-width drop-down menu with several posts appears. Like shown in this screenshot: This is a navigation item that enables the Mega Menu effect. What is Mega Menu? &#8220;A mega menu is typically defined as a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-start"],"_links":{"self":[{"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":5,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/posts\/26\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.loftocean.com\/eaven\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}