{"id":45112,"date":"2015-08-08T01:24:18","date_gmt":"2015-08-08T05:24:18","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=45112"},"modified":"2017-08-11T06:32:28","modified_gmt":"2017-08-11T10:32:28","slug":"wordpress-how-to-work-with-page-blocks-and-assign-them-to-main-menu","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/wordpress-how-to-work-with-page-blocks-and-assign-them-to-main-menu.html","title":{"rendered":"WordPress. How to work with page blocks and assign them to main menu"},"content":{"rendered":"<p>\r\n<p>This tutorial shows how to create an <strong>internal link<\/strong> for a specific <strong>page block<\/strong> and assign it to the <strong>main menu<\/strong> in WordPress.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=l8Mi9-JZJtE?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to work with page blocks and assign them to main menu<\/a><\/p>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-3-(835-x100).jpg\" \/>\r\n<\/a>\r\n<\/div>\r\n<p>There are several ways of creating an <strong>internal link<\/strong>. In this tutorial we will use an <strong>id<\/strong> attribute of an element as a hook for a link.<\/p>\r\n<p>In order to create an <strong>internal link<\/strong>, you should perform the following:<\/p>\r\n<ol>\r\n<li>\r\n<p>Log into your <strong>Dashboard<\/strong>, go to <strong>Pages -> All Pages<\/strong> and open the page that has the block in question in the <strong>Text editor<\/strong> mode:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-1-300x169.jpg\" alt=\"Untitled-1\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-51647\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-1-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-1-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-1-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-1.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n<li>\r\n<p>Locate the title of the block you&#8217;d like to link. You can use the search tool for that:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-2-300x169.jpg\" alt=\"Untitled-2\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-51648\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-2-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-2-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-2-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-2.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n<li>\r\n<p>Check whether the heading you have located has already an <strong>id<\/strong> attribute. If it doesn&#8217;t, create it. The result should look like this:<\/p>\r\n<pre class=\"brush:css\">\r\n&lt;h2 id=\"we_provide\" style=\"text-align: center;\"&gt;We Provide&lt;\/h2&gt;\t\t\t\r\n\t\t\t<\/pre>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-3-300x169.jpg\" alt=\"Untitled-3\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-51649\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-3-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-3-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-3-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-3.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n<li>\r\n<p>After you have found or added an <strong>id<\/strong> attribute to the header element of your block, copy the <strong>id<\/strong> attribute or write it down.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Go to <strong>Appearance -> Menus<\/strong> select from the drop down <strong>Header Menu (Header Menus)<\/strong>, click <strong>Select<\/strong>.<\/p>\r\n<\/li>\r\n<li>\r\n<p>On the left you&#8217;ll see three options to insert a menu item: <strong>Pages<\/strong>, <strong>Custom Links<\/strong> and <strong>Categories<\/strong>. Select the <strong>Custom Links<\/strong> option and enter the URL for your new link in the form of <strong>http:\/\/my.website.com\/#id<\/strong>, where <strong>http:\/\/my.website.com\/<\/strong> is your home page URL and <strong>#id<\/strong> is the <strong>id<\/strong> attribute of the block you&#8217;d like to link. Note, if the block is situated on the <strong>home page<\/strong>, you don&#8217;t need to specify the home page URL just <strong>#id<\/strong>. After you have filled out the <strong>URL<\/strong> and <strong>Link Text<\/strong> fields, click <strong>Add to Menu<\/strong> and <strong>Save Menu<\/strong>:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-4-300x169.jpg\" alt=\"Untitled-4\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-51651\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-4-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-4-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-4-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-4.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n<li>\r\n<p>Refresh the home page of your site and you will see a new menu item added to the main menu that links to the specific block on the page:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-5.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/03\/Untitled-5-300x169.jpg\" alt=\"Untitled-5\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-51652\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-5-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-5-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-5-1024x576.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/03\/Untitled-5.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t\t<\/li>\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=l8Mi9-JZJtE?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to work with page blocks and assign them to main menu<\/a><br \/>\r\n<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create an <strong>internal link<\/strong> for a specific <strong>page block<\/strong> and assign it to the <strong>main menu<\/strong> in Wordpress.<\/p>\n","protected":false},"author":85,"featured_media":45121,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[728],"tags":[618,571,572,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/45112"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=45112"}],"version-history":[{"count":1,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/45112\/revisions"}],"predecessor-version":[{"id":82663,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/45112\/revisions\/82663"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/45121"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=45112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=45112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=45112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}