<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by WP Meta Box Plugin on Medium]]></title>
        <description><![CDATA[Stories by WP Meta Box Plugin on Medium]]></description>
        <link>https://medium.com/@wpmetabox?source=rss-225304e166e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6yMI8l9iELblqV-7.jpg</url>
            <title>Stories by WP Meta Box Plugin on Medium</title>
            <link>https://medium.com/@wpmetabox?source=rss-225304e166e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:32:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wpmetabox/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Create a Recipe — P7 — Using Meta Box and Breakdance]]></title>
            <link>https://medium.com/@wpmetabox/how-to-create-a-recipe-p7-using-meta-box-and-breakdance-36472dc6b315?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/36472dc6b315</guid>
            <category><![CDATA[recipe]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[breakdance]]></category>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 02:18:10 GMT</pubDate>
            <atom:updated>2023-03-28T02:19:30.943Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Recipe — P7 — Using Meta Box and Breakdance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCG3URdti0tEkPzRFtWf9A.jpeg" /></figure><p>In the previous posts of <a href="https://metabox.io/series/recipe/">this series</a>, we’ve gone through some ways to create a Recipe page using page builders. In today’s practice, we’re going to find out how to do it with another page builder: <strong>Breakdance</strong>.</p><p>This is the singular page that I created as an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qXdrkODunqqoVU-B.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/ybqLQFFMu5c">https://youtu.be/ybqLQFFMu5c</a></p><h3>Before Getting Started</h3><p>Each recipe is saved in a post of a custom post type and further information such as time, ingredients and so on will be saved in custom fields. So, we need <a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a> to have a framework for creating custom post types and custom fields easily. It’s free and you can download it directly from <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>.</p><p>For the advanced features from Meta Box, we need some of its extensions:</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: to create custom post types and custom taxonomies;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li></ul><p>They’re all in the <strong>Meta Box AIO</strong>. If you haven’t had it, you can download and install each one individually.</p><p>Since this page is built by <strong>Breakdance</strong>, make sure you have it on your site.</p><h3>Create a New Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G1-k6HxAQ6d-mFKX.png" /></figure><p>After publishing, you will see a new <strong>Recipes</strong> menu like this in the Admin Dashboard.</p><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box &gt; Custom Fields</strong>. Here are the fields that I created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*uY1Qp7WzzAVHxbEI.png" /></figure><p>There is a special field that is one for video. Instead of using the <strong>URL</strong> field to save the video link, I use <strong>oEmbed</strong>. This field type allows us to display the video preview directly on the frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jQOvryKuRXjs9thF.png" /></figure><p>After creating all the fields, move to the <strong>Settings</strong> tabs, choose <strong>Location</strong> as <strong>Post Type</strong> and select <strong>Recipe</strong> to apply these fields to this custom post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hD-dPH9g5-MVSlEm.png" /></figure><p>Then, you can easily see all the created fields in the post editor. Just fill in data into them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*g6DqYEW5ziJieztZ.png" /></figure><h3>Create a Template for the Page</h3><p>Go to <strong>Breakdance &gt; Add New</strong> to create a new template for the single post page of the recipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*8RarKVP9zdrcdlqK.png" /></figure><p>First, add a <strong>Section</strong> element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Gk9bKxeJ--rokxts.png" /></figure><p>Since the name of the recipe is the title of the post, add a <strong>Post Title</strong> element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ysUeOHDGRpshutBb.png" /></figure><p>I’ll use some <strong>Div</strong> tags to divide content into sections and columns as you can see here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jJKprr5fjpQq8fwo.png" /></figure><p>Then, add the <strong>Post Featured Image</strong> element to display the picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*WZXvgqHU25is_f82.png" /></figure><p>The cooking time and others similar are in another column, so I also add another <strong>Div</strong> element. Adding a <strong>Text</strong> element inside, then insert dynamic data to it. Choose the corresponding field of the kind of time you want to display from the <strong>Metabox</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*sNmfH3H1Oq6Qy30X.gif" /></figure><p>You’ll immediately see the number here. To know which kind of it, you can add a prepend or append text for the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AHv_6wpFOb6RU3Qf.gif" /></figure><p>For others, duplicate the element, then change the connecting field as well as the append text.</p><p>Leave this first section with two columns, add a new <strong>Div</strong> element for the new section. Add a heading for it. For the content that saves in the corresponding custom field, add a <strong>Text</strong> element, then insert data from that field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9tsgg-ai22QgqSjX.png" /></figure><p>Do likewise with other sections or just <strong>duplicate</strong> this <strong>Div</strong> element. Also change the heading, and the connecting field of the Text element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*TIMPANdokIyUEZFY.png" /></figure><p>For the <strong>Video</strong> section, instead of using <strong>Text</strong> element, I’ll use <strong>Video</strong> element and connect it with the Video field. There is the preview because I set the custom field in the type of <strong>oEmbed</strong>. In the case you use any other field type, the URL may display in the kind of text instead of a video preview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*WdR8BpGhLnUEVjit.png" /></figure><p>We’ve done all the information about the recipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UGflvn3deWuJWF8k.png" /></figure><h3>Style the Page</h3><p>Still in the template editor, change the settings of each element to have as your desire. Just customize one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VPkI71_2MSkJQE4w.png" /></figure><p>Then you will see the new look of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*e29r38W93yHTFjoa.png" /></figure><h3>Last Words</h3><p>We’ve found out <strong>how to create a Recipe</strong> <strong>page</strong> using <strong>Meta Box</strong> and <strong>Breakdance.</strong> In the event that you use other page builders, refer more here. Or if you want to suggest any tutorials, feel free to leave a comment and keep track of our blog. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36472dc6b315" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Show Posts with Specific Criteria — P2 — Using Meta Box and Oxygen]]></title>
            <link>https://medium.com/@wpmetabox/how-to-show-posts-with-specific-criteria-p2-using-meta-box-and-oxygen-7417dbec31f7?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7417dbec31f7</guid>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[oxygen]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 01:02:14 GMT</pubDate>
            <atom:updated>2023-03-21T01:02:14.468Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Show Posts with Specific Criteria — P2 — Using Meta Box and Oxygen</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QwEPTJwiaJC7Jkd6b6nJ6g.jpeg" /></figure><p>If you’re having an e-commerce website and there are some on-sale products, you may want to display them on a page for the promotion campaign only. In this practice, we’ll find out how to <strong>show posts with this kind of specific criteria</strong> using <strong>Meta Box</strong> and <strong>Oxygen</strong>.</p><p>This is the archive page that I created as an example. Only products are on sale will be displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cUBxhrg2HdROaJeM.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/MeshaXL1hrg">https://youtu.be/MeshaXL1hrg</a></p><h3>Before Getting Started</h3><p>The products will be the dishes which are posts of a custom post type. In addition to the basic information of the dishes such as the name, description and the image of the dish, there may be some extra information. They’ll be saved in custom fields.</p><p>In this case, I have two fields in order to save the original price and the promotional price. All the dishes, which have the promotional price, are on sale and will be displayed on the page.</p><p>In this practice, we need these tools:</p><ul><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: to have a framework to create custom post types and custom fields;</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: to create custom post types;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li><li><a href="https://metabox.io/plugins/mb-admin-columns/">MB Admin Columns</a> (optional): to display custom fields as an admin column.</li></ul><p>Since we will use Oxygen to build the page, make sure you have it on your site and use version 3.9 or upper to have full integration with Meta Box.</p><h3>Create a Custom Post Type</h3><p>Go to <strong>Meta Box</strong> &gt; <strong>Post Types</strong> &gt; <strong>Add New</strong> to create a new post type for the dishes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*YbT2sFnxf6R2MeDp.png" /></figure><p>Then, you will see a new menu like this in the <strong>Admin Dashboard</strong>. It’s your post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/0*mYBJbznq9FW42pPU.png" /></figure><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box</strong> &gt;<strong> Custom Fields</strong> to create a new field group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*euZgh2oF1nbfroLk.png" /></figure><p>Here are 2 fields I created as an example. The value stored in these 2 fields will be set to the condition to choose which dishes will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*PnvLo5oDh2Y05bVF.png" /></figure><p>Since I want to know which dishes are having promotion, I set to show both these fields as an admin column like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6yRuzLQtlGK2MrBQ.png" /></figure><p>To do it, you will need to tick this box in both fields. You will have this setting when you enable the <strong>MB Admin Columns</strong> extension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Jh0rvQGFlcQu1eNE.png" /></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab &gt; <strong>Location</strong> as <strong>Post type</strong> &gt; select <strong>Cuisines</strong> to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*q4Fm96lydkHBcc2N.png" /></figure><p>Now, you’ll see all the created custom fields in the post editor of the <strong>Restaurants</strong> post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/0*lQTKbBENCdL7ygSO.png" /></figure><h3>Create the Archive Page</h3><h3>Create a Template</h3><p>Go to <strong>Oxygen</strong> &gt; <strong>Templates</strong> to create a new template for the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9yn33xaSRqCn7DpH.png" /></figure><p>Next, create a new page. Note to set the created template to apply it to the page. Then, just <strong>edit the created page with Oxygen</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2pLDZaUUcmxBerH8.png" /></figure><p>Remember to set a preview for the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*x1Zi_JPtV4nPg5_h.png" /></figure><p>First, add a <strong>Section</strong> component to contain all the posts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*9zGkRzjc-YhPNOLG.png" /></figure><p>Then, to have a page title, add a <strong>Heading</strong> component &gt; <strong>Insert Data</strong> button and choose <strong>Title</strong> in the <strong>Post</strong> section to get the name automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BiCYGb3ABQtvIut3.gif" /></figure><p>To set content in sections for easy styling later, you should use some <strong>Div</strong> components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*uv5nnztLD1nVB9k3.png" /></figure><h3>Add the Condition to Display Posts</h3><p>Next, add a <strong>Repeater</strong> component to display all the posts as we want. However, we just choose to show only the dishes which are on sale, so we need to set a condition in the settings of this component.</p><p>In the <strong>Query</strong> section, choose ‘<strong>advanced</strong>’, and edit the query to add some parameters as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*R62VN-Z7VzGI_bKv.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EGNI00dq1egZiGoX.png" /></figure><p>The first parameter means that we’ll get posts from the post type which has the slug as ‘<strong>cuisine</strong>’.</p><p>The second one is the condition based on the ‘<strong>promotional_price</strong>’ field. It means that if the field has any value in the field, the post will be displayed.</p><p>That’s all for the condition.</p><h3>Display the Posts’ Information</h3><p>Let’s add some other components inside the <strong>Repeater</strong> to display the information of the posts.</p><p>Add an <strong>Image</strong> component to get the image of the dishes which is the featured image of the post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3qlVkZNMI4HcyMnT.png" /></figure><p>Click the <strong>Select Dynamic Data</strong> button as below picture, and choose the <strong>Featured Image</strong> option from the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XbeR3vAgEGu4zP-q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*eynAeByNLbKQkvk7.png" /></figure><p>Then, you’ll see all the featured images of the posts displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Lqv4MSTc397wn1Mo.png" /></figure><p>To get the names of the dishes from the post title, add a <strong>Heading</strong> component &gt; <strong>Insert Data</strong> button &gt; choose <strong>Title</strong> in the <strong>Post</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*4VoEs3M5GosZv6BK.gif" /></figure><p>For the original price of the dish, use the <strong>Text</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JvhVt6iEDTZrbDT_.png" /></figure><p>Choose <strong>Insert Data</strong> to get the data that saves in the custom fields. Since the field is created by Meta Box, select the <strong>Meta Box Field</strong> option and choose the corresponding field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*O2CjrOmn6gzOVmWZ.gif" /></figure><p>You’ll see the original price of the dishes displayed immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*eXNgN9iv4Aio_weF.png" /></figure><p>For the promotional price, do likewise. Or you can duplicate the <strong>Text</strong> component used for the original price and just change the field connecting with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Onh4oEXdLYkArSyq.png" /></figure><p>For the description of the dish which is the post content, add a <strong>Text</strong> component as well. Then insert data from the <strong>Content</strong> fields of the post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-QZ31yKRYM0jV0jh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*YucqdIwH3q2ukm8y.png" /></figure><p>Now, all the information has been obtained and displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*j0M4aHtaCb7rh892.png" /></figure><h3>Style the Page</h3><p>For styling, still in the page editor with <strong>Oxygen</strong>, you can style each component by changing their settings in the <strong>Advanced</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kLWLRhOKi8mdW-5m.png" /></figure><p>Then, you will see a new look of the page on the frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*oosXCwaXnuKbUO0T.png" /></figure><h3>Last Words</h3><p>We’ve found out how to <strong>show posts with specific criteria</strong> using <strong>Meta Box</strong> and <strong>Oxygen</strong>. In the event that you use other page builders, refer more here. Or if you want to suggest any tutorials, feel free to leave a comment and keep track of our blog. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7417dbec31f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Recipe — P6 — Using Meta Box and Brizy]]></title>
            <link>https://medium.com/@wpmetabox/how-to-create-a-recipe-p6-using-meta-box-and-brizy-17a160ae1740?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/17a160ae1740</guid>
            <category><![CDATA[brizy]]></category>
            <category><![CDATA[create-custom-field]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 02:43:49 GMT</pubDate>
            <atom:updated>2023-03-14T02:57:37.143Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Recipe — P6 — Using Meta Box and Brizy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ZR-2fJST0YpcFNOJnKjCQ.jpeg" /></figure><p>In the prior posts of <a href="https://metabox.io/series/recipe/">this series</a>, we’ve known how to <strong>create a Recipe page</strong> using some of the page builders. In today’s practice, we’ll use another one named <strong>Brizy</strong> to do it with the help of <strong>Meta Box</strong>.</p><p>This is an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-zxa_wjj91Zsq5VZ.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/wCKxZEQ4uRE">https://youtu.be/wCKxZEQ4uRE</a></p><h3>Before Getting Started</h3><p>Each recipe is saved in a post of a custom post type and displayed in a single page. Besides some default fields that may help to save some basic information. You may want to have more space for the extra ones. So, we need custom fields for them.</p><p>To get started, we need the <a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a> to have the framework for creating custom post types and custom fields. It’s free and you can download it directly from <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>.</p><p>For the advanced features from Meta Box, we need some of its extensions:</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: to create custom post types and custom taxonomies;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li><li><a href="https://www.brizy.io/">Brizy</a> (Brizy Pro version): to build the pager.</li></ul><h3>Create a Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong> to create a new post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*aKOiPxRIULzI7e-Z.png" /></figure><p>After publishing, we’ll have a menu named <strong>Recipe</strong> in the <strong>Admin Dashboard</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/0*pnZZFZ7S-bXGB8TW.png" /></figure><p>Let’s create custom fields in the next step.</p><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box &gt; Custom Fields</strong> to create fields. These are the fields that I created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5e67JV3zUU2EDEuK.png" /></figure><p>Pay attention to a special field for the video. Since <strong>Brizy</strong> supports displaying the video preview from the link saved in the type of text. So, instead of using the <strong>URL</strong> field or the <strong>oEmbed</strong> to save the video link as other tutorials, I’ll use the <strong>Text</strong> field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7FKlpbXqpT_YC1r2.png" /></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab, choose <strong>Location</strong> as <strong>Post Type</strong> and then select <strong>Recipe</strong> to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*RWfBhbTizted-CJA.png" /></figure><p>Then, you can easily see all the created custom fields in the post editor. Just fill in the recipe’s details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/0*8jmyfWwZNs1lcSQL.png" /></figure><h3>Create the Page</h3><p>Go to <strong>Brizy &gt; Templates</strong> to create a new template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dKtRAjLRUQn4z9Ti.png" /></figure><p>Remember to set the condition to set this template for the single post/page of the Recipe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VyhnimmMFMipaCtu.png" /></figure><p>First, go to the <strong>Global Blocks</strong> to set the header for the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jX1pO0NNPygVCnzT.png" /></figure><p>To display the name of the recipe, add a <strong>Title</strong> element. It’ll automatically get the data from the post title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*_v17jGMprMe66fMp.png" /></figure><p>For the first section, I divided information into two columns. One column is for the image of the recipe and the other is for the timing information. So, add a <strong>Column</strong> element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*nsf8TuFD4H9-ZSzB.png" /></figure><p>Drag the <strong>Featured Image</strong> element to the first column. The image will be displayed immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*U33IU_vddWUjql4K.png" /></figure><p>Next, I’ll add <strong>Row</strong> inside the second column. Each row will be used for each type of timing information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Fm9ENEug2lTKV8_G.png" /></figure><p>Inside the row, add a <strong>Text</strong> element, then choose <strong>Typography</strong> to customize the text. You will see a small icon button to choose more options from a dropdown list for the text.</p><p>The first one is to add a custom text that you can type any text as you want into the element. All the rest ones on the list are the names of custom fields. Since we save the data about the time in custom fields, choose the corresponding ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7oRMw8R4KhH1B2i8.gif" /></figure><p>To compare the type of time, add another <strong>Text</strong> element. Set it as <strong>Custom Text</strong> to change the text into the type of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1xBZk-sN8daOeYeS.gif" /></figure><p>For other information about the time, do likewise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/0*4IRNyGjf4MM_3Och.png" /></figure><p>Now, let’s get the <strong>Ingredient</strong> section. Add a <strong>Text</strong> element and set it as a heading. Then, type the name of the section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*uEaWzoyWR4er_nO1.png" /></figure><p>To display the information about the ingredients that is stored in custom fields, add another <strong>Text</strong> element below the heading and also connect it to a custom field. The content will be displayed immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JAIcFxSX2EOuMd-X.gif" /></figure><p>For other sections, just do the same.</p><p>In the <strong>Video</strong> section, instead of adding <strong>Text</strong>, add a <strong>Video</strong> element. A default video will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*OJd4NUN1bG2p1Lg_.png" /></figure><p>To display the video about the recipe, click to the preview button. Beside the pre-set link, there is also the icon to connect with custom fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*vUFxeB7wQlpbCEA7.png" /></figure><p>We’ve done getting all the information about the recipe. Add a new block and then go to the Global Blocks section once again to add the footer for the page.</p><p>This is how it displays on the frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*JYoMbTXZGy0nLkdN.png" /></figure><h3>Style the Page</h3><p>Back to the template editor of <strong>Brizy</strong>, you can change the column width as well as the settings of each element to have the style as you want. Just customize one by one, then you will see the new look of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*W6JNjEFdEqBeiH6T.png" /></figure><p>Here is the result that I want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*uu9qJZ4kmSdQ9mG3.png" /></figure><h3>Last Words</h3><p>We’ve found out how to create a Recipe page using <strong>Meta Box</strong> and <strong>Brizy</strong>. More information is available here if you use other page builders. Keep an eye on our site for more insightful tutorials and feel free to suggest any ideas for us. Good luck!</p><p>— — — The publication at <a href="https://metabox.io/create-a-recipe-p6-meta-box-brizy/">Meta Box</a> — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17a160ae1740" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Display Opening Hours for Restaurants — P2 — Using Meta Box and Oxygen]]></title>
            <link>https://medium.com/@wpmetabox/how-to-display-opening-hours-for-restaurants-p2-using-meta-box-and-oxygen-e4326c5b50f5?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4326c5b50f5</guid>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 02:34:14 GMT</pubDate>
            <atom:updated>2023-02-28T02:34:14.088Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display Opening Hours for Restaurants — P2 — Using Meta Box and Oxygen</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_i2niP4fMiGk9fBJbjx-jg.jpeg" /></figure><p>In a website for booking restaurants, there will be a lot of different restaurants. Definitely, each restaurant has its own opening hours and you may want to create a section for the opening time for each one. So, in this next part of the series, we’re going to figure out <strong>how to add an opening hours section into the singular page</strong> by <strong>Meta Box</strong> and <strong>Oxygen</strong>.</p><p>This section will be the same as the last ones we created in the <a href="https://metabox.io/display-restaurant-opening-hours-p1-meta-box-gutenberg/">previous post</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3y6a4tXrVVDgDQDm.png" /></figure><h3>Before Getting Started</h3><p>In this case, I want to put the opening hours section for a particular restaurant. And each restaurant including its own information will be displayed on a singular page. So, all the detailed information about the restaurants’ working time will be saved in custom fields stored in the post containing the restaurants’ information.</p><p>We’ll display some extra information such as time slots for each day, and we’ll use custom fields. So, we need <a href="https://metabox.io/">Meta Box plugin</a> to have a framework to create them. It’s free on <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>. We also need additional Meta Box advanced features, which are accessible in the following extensions:</p><ul><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: this premium extension of Meta Box provides an intuitive UI in the back end to create and configure custom fields without using code;</li><li><a href="https://metabox.io/plugins/meta-box-group/">Meta Box Group</a>: this extension helps to arrange fields into groups;</li><li><a href="https://metabox.io/plugins/meta-box-conditional-logic/">Meta Box Conditional Logic</a>: this premium extension allows you to create rules to control the display of the fields.</li></ul><p>Finally, <a href="https://oxygenbuilder.com/">Oxygen Builder</a>. Remember to use the 3.9 version or upper to have the native integration with Meta Box.</p><h3>Create a Custom Post Type</h3><p>If you read the <a href="https://metabox.io/display-restaurant-opening-hours-p1-meta-box-gutenberg/">previous post</a> in this series, you can skip this step. In the event that you haven’t had a post type yet, just create a new one as usual.</p><p>Go to <strong>Meta Box &gt; Post Types</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*KF06lQLdTEqBl46j.png" /></figure><h3>Create Custom Fields</h3><p>This step is the same as what I showed in the <a href="https://metabox.io/display-restaurant-opening-hours-p1-meta-box-gutenberg/">previous post</a> about displaying opening hours.</p><p>Go to <strong>Meta Box &gt; Custom Fields &gt; Add New</strong> to create a new field group. Then, add custom fields with the structure like this:</p><p><strong>NameIDTypeOptionsCondition</strong>Choose an optionchoose_an_optionselect</p><p>1. all_days_are_the_same</p><p>2. difference_between_weekdays_and_weekend</p><p>3. custom</p><p>All days have the same opening hoursall_days_have_the_same_opening_hoursgroup</p><p>display only when:</p><p>the <em>choose_an_option</em> field = the <em>all_days_are_the_same</em> option</p><p>Type of opening hourstype_of_opening_hoursselect</p><p>1. open_all_day</p><p>2. close_all_day</p><p>3. by_appointment_only</p><p>4. enter_hours</p><p>Choose time slotschoose_time_slotsgroup display only when: the <em>type_of_opening_hours</em> field = the <em>enter_hours</em> optionStart timestart_timetime picker End timeend_timetime picker Weekdaysweekdaysgroup display only when: the <em>choose_an_opton</em> field = the <em>difference_between_weekdays_and_weekend</em> optionType of opening hourstype_of_opening_hours<strong>_weekdays</strong>select</p><p>1. open_all_day</p><p>2. close_all_day</p><p>3. by_appointment_only</p><p>4. enter_hours</p><p>Choose time slotschoose_time_slots<strong>_weekdays</strong>group display only when: the <em>type_of_opening_hours_weekdays</em> field = the <em>enter_hours</em> optionStart timestart_time<strong>_weekdays</strong>time picker End timeend_time<strong>_weekdays</strong>time picker Weekendweekendgroup display only when: the <em>choose_an_opton</em> field = the <em>difference_between_weekdays_and_weekend</em> optionType of opening hourstype_of_opening_hours<strong>_weekend</strong>select</p><p>1. open_all_day</p><p>2. close_all_day</p><p>3. by_appointment_only</p><p>4. enter_hours</p><p>Choose time slotschoose_time_slots<strong>_weekend</strong>group display only when: the <em>type_of_opening_hours_weekend</em> field = the <em>enter_hours</em> optionStart timestart_time<strong>_weekend</strong>time picker End timeend_time<strong>_weekend</strong>time picker Mondaymondaygroup display only when: the <em>choose_an_option</em> field = the <em>custom</em> optionType of opening hourstype_of_opening_hours<strong>_monday</strong>select</p><p>1. open_all_day</p><p>2. close_all_day</p><p>3. by_appointment_only</p><p>4. enter_hours</p><p>Choose time slotschoose_time_slots<strong>_weekend</strong>group display only when: the <em>type_of_opening_hours_monday</em> field = the <em>enter_hours</em> optionStart timestart_time<strong>_weekend</strong>time picker End timeend_time<strong>_weekend</strong>time picker ……………Sunday…………</p><p>As you saw in the table above, the first field is a <strong>Select</strong> field and there are 3 options that I filled in the <strong>Choice</strong> box as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*IthG0MfdqEqZCcqr.png" /></figure><p>These 3 options will be used to set the display rule of other group fields.</p><p>To set conditions to groups, for example, with the <strong>All days have the same opening hours</strong> group. Go to the <strong>Advanced</strong> tab, and then set the rule in the <strong>Conditional Logic</strong> section like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*TXbgthn1V1IfJvYm.png" /></figure><p>This rule means this group will be displayed when the <strong>Choose an Option</strong> field is selected as <strong>All days have the same opening hours</strong> option which has the value is <strong>all_days_are_the_same</strong>.</p><p>Similarly, if the <strong>Choose an Option</strong> field is chosen as the <strong>Difference between weekdays and weekend</strong> option, all the subfields of the <strong>Weekdays</strong> and <strong>Weekend</strong> group will be displayed. Or if the <strong>Choose an Option</strong> field is selected as the <strong>Custom</strong> option, the group fields for every day in a week will be shown up. That’s the concept of how to create fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*E03Qs5ecYHq2i9uw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*t3pTlCUiqE3yNJ56.png" /></figure><p>In each group field, I also have subfields with the same structure.</p><p>The <strong>Type of Opening Hours</strong> field is select field. I have 4 options in the <strong>Choice</strong> box:</p><ul><li>Open All day;</li><li>Close All day;</li><li>By Appointment Only;</li><li>Enter Hours.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*vPeo2z6ZKuIj02ao.png" /></figure><p>The second subfield is a Group field named Choose Time Slots. Inside it, there are two subfields: <strong>Start Time</strong> and <strong>End Time</strong>.</p><p>If the restaurant has multiple opening hours, you can choose <strong>Enter Hours</strong> to display the <strong>Start Time</strong> and <strong>End Time</strong> field in the <strong>Choose Time Slots</strong> group. So, I will set the rule for this group like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ahWVJ_k6tiODPTtB.png" /></figure><p>In case the restaurant opens in multiple time slots, we’ll need this group to be cloneable. So, I tick this box as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*PJFqH32PUbw4BLzu.png" /></figure><p>After creating all the fields, go to the <strong>Settings</strong> tab of the field group, choose <strong>Location</strong> as <strong>Post Type</strong>, and select <strong>Restaurant</strong> to apply these fields to this post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VPmPeMsq5zgWjRZN.png" /></figure><p>Publish this field group and go to the post editor in <strong>Restaurant</strong>, you will see the custom fields here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*AUag_zJ1PigWlf9m.gif" /></figure><p>They work exactly like the rule we set.</p><h3>Display the Fields’ Value</h3><p>We’ll display the opening hours section using Oxygen. If you’ve had a template created by Oxygen for the Restaurant singular page, just go and edit it.</p><p>In the event you haven’t had one, go to <strong>Oxygen &gt; Template &gt; Add New Template</strong> to create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2D_IZTwyfbFwTT96.png" /></figure><p>Here, I’ve already had it. So, I just click <strong>Edit with Oxygen</strong>.</p><p>Next, add a new <strong>Div</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mCw2WUWSh2wOsVm2.png" /></figure><p>In this practice, it includes some complex conditions to choose which fields will be got the value from. However, Oxygen hasn’t supported logic to choose which field yet, we need to use code in this practice. So, I will add a <strong>Code Block</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*HVPMU-ExXa_LxYTw.png" /></figure><p>Then, choose the <strong>PHP&amp;HTML</strong> and you will see a space to add code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*er5oxLm6VXgegCc6.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rN15BLzV6Pjc72DV.png" /></figure><p>The code is quite long, so I put it in my Github <a href="https://github.com/wpmetabox/tutorials/blob/master/display-opening-hours-with-Oxygen/template.php">here</a>. You can refer to it for more details. The code is divided into several parts to get corresponding group data. Because of the same concept in all parts, I’ll explain a typical part to be more clear about the logic.</p><pre>&lt;?php $options = rwmb_meta( &#39;choose_an_option&#39; ); ?&gt;<br>&lt;?php if ( $options == &quot;all_days_are_the_same&quot; ): ?&gt;<br>    &lt;?php $same_days = rwmb_meta( &#39;all_days_have_the_same_opening_hours&#39; ); ?&gt;<br>        &lt;?php $same_days_option = $same_days[&#39;type_of_opening_hours&#39;]; ?&gt;<br>        &lt;?php $choose_time_slots = $same_days[&#39;choose_time_slots&#39;] ?&gt;<br>        &lt;?php if ( $same_days_option == &quot;enter_hours&quot; ): ?&gt;<br>            &lt;?php foreach ( $choose_time_slots as $time_slots ): ?&gt;<br>                &lt;?php echo $time_slots[&#39;start_time&#39;] ?&gt;<br>                &lt;?php echo $time_slots[&#39;end_time&#39;] ?&gt;<br>            &lt;?php endforeach; ?&gt;<br>        &lt;?php else: ?&gt;<br>            &lt;?php <br>            $select_field = isset( $same_days[&#39;type_of_opening_hours&#39;] ) ? $same_days[&#39;type_of_opening_hours&#39;] : &#39;&#39;;<br>            $group_field = rwmb_get_field_settings( &#39;all_days_have_the_same_opening_hours&#39; );<br>            foreach ( $group_field[&#39;fields&#39;] as $field ) {<br>                if ( empty( $field[&#39;options&#39;] ) ) {<br>                    continue;<br>                }<br>            ?&gt;<br>            &lt;?php if($field[&#39;options&#39;][$select_field]): ?&gt;<br>                &lt;?= $field[&#39;options&#39;][$select_field]; ?&gt;<br>            &lt;?php endif; ?&gt;<br>            &lt;?php } ?&gt;<br>        &lt;?php endif; ?&gt;</pre><p>Let’s get through each line with me.</p><pre>&lt;?php $options = rwmb_meta( &#39;choose_an_option&#39; ); ?&gt;</pre><p>I created a variable to get the value of the field <strong>Choose an Option</strong> which has the <strong>ID</strong> is <em>choose_an_option</em>. We will create a condition based on the returned value to decide which fields will be got the value from.</p><pre>&lt;?php if ( $options == &quot;all_days_are_the_same&quot; ): ?&gt;<br>&lt;?php $same_days = rwmb_meta( &#39;all_days_have_the_same_opening_hours&#39; ); ?&gt;</pre><p>If the returned value is the first option, we will get the value of <strong>All days have the same opening hours</strong> group.</p><pre>&lt;?php $same_days_option = $same_days[&#39;type_of_opening_hours&#39;]; ?&gt;<br>&lt;?php $choose_time_slots = $same_days[&#39;choose_time_slots&#39;] ?&gt;</pre><p>I also have 2 following variables that obtain the value of two fields: <strong>Type of Opening Hour</strong> and <strong>Choose Time Slots</strong>. They are the subfields of the <strong>All days have the same opening hours</strong> group.</p><p>Since the <strong>Type of Opening Hour</strong> is a <strong>Select</strong> field with some options as the image below, based on the returned value of this field, we’ll get value from the <strong>Choose Time Slots</strong> group or not.</p><pre>&lt;?php if ( $same_days_option == &quot;enter_hours&quot; ): ?&gt;<br>    &lt;?php foreach ( $choose_time_slots as $time_slots ): ?&gt;<br>        &lt;?php echo $time_slots[&#39;start_time&#39;] ?&gt;<br>        &lt;?php echo $time_slots[&#39;end_time&#39;] ?&gt;<br>    &lt;?php endforeach; ?&gt;</pre><p>If the returned value of the <strong>Type of Opening Hour</strong> field is <strong>Enter hours</strong>, we’ll display the value from the <strong>Choose Time Slots</strong> group field with its subfields: <strong>Start Time</strong> and <strong>End Time</strong> fields. Since the <strong>Choose Time Slots</strong> group is cloneable, we have a loop here.</p><pre>&lt;?php <br>$select_field = isset( $same_days[&#39;type_of_opening_hours&#39;] ) ? $same_days[&#39;type_of_opening_hours&#39;] : &#39;&#39;;<br>$group_field = rwmb_get_field_settings( &#39;all_days_have_the_same_opening_hours&#39; );<br>    foreach ( $group_field[&#39;fields&#39;] as $field ) {<br>        if ( empty( $field[&#39;options&#39;] ) ) {<br>            continue;<br>        }<br>?&gt;<br>    &lt;?php if($field[&#39;options&#39;][$select_field]): ?&gt;<br>        &lt;?= $field[&#39;options&#39;][$select_field]; ?&gt;<br>    &lt;?php endif; ?&gt;<br>&lt;?php } ?&gt;</pre><p>For other options in the <strong>Type of opening hours</strong> field, the above is used to display the label of that selected option.</p><p>That’s the end of the first section, corresponding to the first option of the <strong>Choose an Option</strong> field.</p><p>If separate days have different opening hours, call the values from the remaining groups.<br>The structure of those groups is the same as the <strong>All days have the same opening hours</strong> group, so just simply follow the same logic in the code.</p><p>This section on the page is now displayed like this because this code is for getting data from custom fields only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*pl-V9EHj26xR6mxY.png" /></figure><p>To have the display with some other texts as the demo, I’ll add some heading, div tags and class for easier styling later. I’ve uploaded the code on <a href="https://github.com/wpmetabox/tutorials/blob/master/display-opening-hours-with-Oxygen/template.php">Github</a>, you can refer to it.</p><p>Now, all the time slots with some additional texts are shown in the section already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cneYzx-Asi9AbGBO.png" /></figure><p>However, it doesn’t look as beautiful as I want. So, I will add some CSS to style this section in the next step.</p><h3>Style the Section</h3><p>For styling, you can go back to the Oxygen visual builder and style each component if any.<br>In this case, I‘ll add some CSS by going to <strong>Manage &gt; Stylesheet</strong> and <strong>Add Stylesheet</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*SXzHrSYkmLT9Avsp.gif" /></figure><p>This is the CSS that I’ve used:</p><pre>.container.detail-restaurant .opening-hours {<br>max-width: 300px;<br>margin: 0 auto;<br>width: 100%;<br>}</pre><pre>.container.detail-restaurant .opening-hours h2 {<br>margin: 0 0 10px;<br>text-align: center;<br>border: 4px solid rgba(231,57,72,.85);<br>border-right: 0;<br>border-left: 0;<br>}</pre><pre>.container.detail-restaurant .detail-schedule .date-time {<br>display: flex;<br>width: 100%;<br>justify-content: space-between;<br>flex-wrap: wrap;<br>align-items: baseline;<br>}</pre><pre>.container.detail-restaurant .detail-schedule .date-time .hour .starting-hour:after{<br>content: &#39;-&#39;;<br>margin: 0 5px;<br>}</pre><pre>.container.detail-restaurant .detail-schedule .date-time .hour .time-slot {<br>display: flex;<br>}</pre><pre>.container.detail-restaurant .detail-schedule .date-time .date {<br>font-weight: 700;<br>font-size: 15px;<br>}</pre><pre>.container.detail-restaurant .detail-schedule {<br>display: flex;<br>flex-wrap: wrap;<br>justify-content: center;<br>border-bottom: 4px solid rgba(231,57,72,.85);<br>padding-bottom: 10px;<br>}</pre><p>Let’s see how the opening hour section displays on the frontend. It’s much more beautiful, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fDKSKyLpENYY1DU6.png" /></figure><p>To refer to all the code that I used, you can visit here.</p><h3>Last Words</h3><p>We’ve gone through all the procedures to display the Opening Hours section using Meta Box plugin and Oxygen Builder. Try it out and let us know how it goes in the comment section. If you have projects using Meta Box and Gutenberg, refer to our <a href="https://metabox.io/display-restaurant-opening-hours-p1-meta-box-gutenberg/">prior post</a> in this series. Or if you have any tutorial suggestions, feel free to leave a comment. Thank you for reading. Best of luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4326c5b50f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Show Posts with Specific Criteria — P1 — Using Meta Box and Bricks]]></title>
            <link>https://medium.com/@wpmetabox/how-to-show-posts-with-specific-criteria-p1-using-meta-box-and-bricks-d692653bc43c?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d692653bc43c</guid>
            <category><![CDATA[condition]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[custom-fields]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 02:22:52 GMT</pubDate>
            <atom:updated>2023-02-21T02:22:52.751Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Show Posts with Specific Criteria — P1 — Using Meta Box and Bricks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfCpv1sijcfw79hSuB2V-Q.jpeg" /></figure><p>In sale seasons, you may want to create an archive page to display only the products which are on sale, then this series is for you. In this practice, we’re going to <strong>show posts with specific criteria</strong>, in this case, it’s the products that are on sale.</p><p>I’ll create a page using Bricks to show them like this with an example of dishes for the products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UrkAs22k0D2Wpb_5.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/fGm74bVzbkg">https://youtu.be/fGm74bVzbkg</a></p><h3>Before Getting Started</h3><p>Each dish is a post of a custom post type and there may be some extra information you want to save in custom fields for them. In this case, I have two fields in order to save the original price and the promotional price. All the dishes which have the promotional price, which means that it’s on sale, will be displayed on the page.</p><p>In this practice, we need these tools:</p><ul><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: to have a framework to create custom post types and custom fields;</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: to create custom post types;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li><li><strong>Bricks Builder</strong>: to create the page.</li></ul><h3>Create a Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong> to create a new post type for the dishes. Here, I name it <strong>Cuisines</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XGyBoiaVBPU-hzgE.png" /></figure><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box &gt; Custom Fields</strong> to create fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Bf4JqIucVEDVLcXB.png" /></figure><p>Here are the two fields that I’ve just created.</p><p>After creating all the fields, move to the <strong>Settings</strong> tab &gt; <strong>Location</strong> as <strong>Post type</strong> &gt; select <strong>Cuisines</strong> to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-hPTjfDkx5P4SCl2.png" /></figure><p>When creating any post in the <strong>Cuisines</strong> post type, you’ll see all created custom fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ErebWW-KnfF76PUL.png" /></figure><h3>Create the Page</h3><p>Go to <strong>Pages &gt; Add New</strong> to create a new page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*f6ARhv2nBKvs9XBA.png" /></figure><p>Then, let’s edit it with Bricks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2TDfZtqq0766Hr8Z.png" /></figure><p>First, add a new <strong>Section</strong> element to contain all the dishes’ information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*_I05m1EabM10VPgh.png" /></figure><p>Next, add a <strong>Heading</strong> element to display the page’s title. Since the title of the page is the post title, choose <strong>Select dynamic data</strong> <strong>&gt; Post title</strong> to get the page’s name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bi4bELQYHcCuBdUM.png" /></figure><p>Now, we’re going to get the dishes. However, we just want to display only the dishes that are on sale. So, we need to set conditions for them. Let’s see how to do it.</p><h3>Set the Condition</h3><p>Inside the <strong>Container</strong>, add a <strong>Div</strong> element to cover all of the post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ygLxh9cw7UeRLaMt.png" /></figure><p>Since each dish is a post of a custom post type, switch the button to enable the <strong>Use the query loop</strong> option and set the query. Choose <strong>Post</strong> and <strong>Cuisines</strong> to get the data from posts of that post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3IOxDssFxOsKoVxQ.png" /></figure><p>Because we just want to display only the posts that are on sale, which means the <strong>Promotional Price</strong> field of those posts must have a value.</p><p>So, scroll down to the <strong>Meta Query</strong> section. Based on the value of the <strong>Promotional Price</strong> fields, we can clarify which dishes to display. Therefore, in the <strong>Meta Key</strong>, fill in the <strong>ID</strong> of the <strong>Promotional Price</strong> field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cQY5o0C3aPY8fU82.png" /></figure><p>Then in the <strong>Compare</strong>, choose <strong>Not equal</strong>. So, all the posts having value in the <strong>Promotional</strong> <strong>Price</strong> fields will be chosen to display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*jCdy2AFp8n6-Ncs1.png" /></figure><p>That’s all for the condition. Next, we’ll display the information you want for each post.</p><h3>Display the Cuisines Information</h3><p>To display the image of the dishes, add the <strong>Image</strong> element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*b1yY5LauKIdV6_jB.png" /></figure><p>Since these images are the featured image of the post, choose the <strong>Select dynamic data</strong> button and find the <strong>Featured Image</strong> option in the <strong>Post</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XXkO3oOPYX39QHYE.png" /></figure><p>Next, to get the name of the dish which is the post title, add a <strong>Heading</strong> element, and choose the <strong>Select dynamic data</strong> button, then find <strong>Post Title</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Npt71iNRuhmkXUg6.png" /></figure><p>After that, add a <strong>Div</strong> element.</p><p>For the price of the dish, instead of adding <strong>Basic Text</strong>, I’d like to use the <strong>Rich Text</strong> element to get information about the price. The <strong>Basic Text</strong> allows you to get the data from the field only, but the <strong>Rich Text</strong> enables adding the extra text along with the data.</p><p>So, to display the original price, add a <strong>Rich Text</strong> element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*PwxK-jXzrVlXOnPH.png" /></figure><p>This is the section of the custom fields created by <strong>Meta Box</strong> for the <strong>Cuisines</strong> post type. Go to <strong>Meta Box (Cuisines)</strong> and then find the <strong>Original Price</strong> field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*iKnwS1G2KgJMa0CS.png" /></figure><p>For the promotional price information, do likewise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VE60W5hg9igMXUy0.png" /></figure><p>To display the description of the dish which is the post content, add a <strong>Basic text</strong> and then connect it to the <strong>Post</strong> <strong>content</strong> fields through the <strong>Select dynamic data button.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-PnNd6J-KSQqzE1w.png" /></figure><p>Now, all the information is shown. This is how it displays on the front end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*E_bmu9d6PuJYNVHQ.png" /></figure><h3>Style the Page</h3><p>Still in the page editor with <strong>Bricks</strong>, style any element you want by changing their settings in the <strong>Style</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*KZX-M-2QUgEUXtBU.png" /></figure><p>The archive page now displays beautifully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*GHcLOe2Inipk6RSt.png" /></figure><h3>Last Words</h3><p>Using custom fields is a brilliant way to create a condition for displaying posts. If you see this practice is helpful, try it out and share the result with us. Or, if you have any suggestions about which tutorial we should make, feel free to leave your comment below. Thanks for reading!<br>______The publication at <a href="https://metabox.io/show-posts-with-specific-criteria-p1-meta-box-bricks/">Meta Box</a>______</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d692653bc43c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Team Members Page — P6 — using Meta Box and Breakdance]]></title>
            <link>https://medium.com/@wpmetabox/how-to-create-a-team-members-page-p6-using-meta-box-and-breakdance-112da677115d?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/112da677115d</guid>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[breakdance]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 02:04:44 GMT</pubDate>
            <atom:updated>2023-02-14T02:04:44.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Team Members Page — P6 — using Meta Box and Breakdance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVZFiTsKWQUuaKcGsaZx6Q.jpeg" /></figure><p>In this series — <a href="https://metabox.io/series/team-members/">Creating a team members page</a>, we’ve done some methods with different page builders. Today, we’ll introduce a way to do it using <strong>Meta Box</strong> and <strong>Breakdance</strong>.</p><p>This is a sample we’ll use for this practice:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*nM20vtmk8NFtG-i0.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/r_9efMiekR0">https://youtu.be/r_9efMiekR0</a></p><h3>Before Getting Started</h3><p>In this case, each member will be a post in a custom post type and will be displayed in a name card as a box, like in the below image. It is created as a global block in Breakdance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*LLy6SPWht4x08opD.png" /></figure><p>In the name card, the name and the avatar of the member are the title and the featured image of the post. Other information such as position, Facebook, Instagram, and Mail will be saved in different custom fields created by Meta Box.</p><p>For this practice, we need some tools:</p><ul><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: to have the framework for creating custom post type and custom fields.</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Type</a>: to create custom post type for the team members;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to provide a UI in the backend to create custom fields easily;</li><li><strong>Breakdance</strong>: to build the page.</li></ul><h3>Create a New Post Type</h3><p>Go to <strong>Meta Box </strong>&gt; <strong>Post Types</strong>, then create a new post type for the members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*PrUNIJIN3u9d4uE7.png" /></figure><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box </strong>&gt; <strong>Custom Fields </strong>&gt; <strong>Add New</strong> to create a new field group.</p><p>Here are the fields that I created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*o4pL5N4_8K4uhdYd.png" /></figure><p>We have <a href="https://youtu.be/_DaFUt92kYY">a tutorial on how to create custom fields</a>, you can refer to it for more information.</p><p>For the position information, choose the <strong>Select</strong> field that allows us to set some options to choose from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6qUc-8Fi7S8k2aVR.png" /></figure><p>For other information such as <strong>Facebook</strong>, <strong>Instagram</strong>, and <strong>Mail</strong>, we set them as the <strong>URL</strong> field to save the link for those social networks.</p><p>After creating all the fields, move to the <strong>Settings</strong> tab &gt; <strong>Location</strong> &gt; choose <strong>Post Type</strong> as the <strong>Team Members</strong> post type to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*krCt8zatIpfGJWSF.png" /></figure><p>Now, go to the post editor, you will see the created custom fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*B5H9uyy_agmult3m.png" /></figure><p>Then, just fill in the information.</p><h3>Create a Global Block</h3><p>Now, let’s create a global block to get and display the team member’s information. Go to <strong>Breakdance</strong> &gt; <strong>Global Blocks</strong> and create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ucbe57u4QBRDfoCK.png" /></figure><p>Remember to set the preview for the global block as a post in the Team Members custom post type.</p><p>My global block is to display the information of each member on a name card. First, we’ll add a div for this name card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-pmHJRJrE5ItkM1f.png" /></figure><p>In this tutorial, each name card has 2 columns. One is to display the avatar and social icons. Another is to display the member information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3zoH0vazKStI2Rmq.png" /></figure><p>To divide the content into 2 columns, I’ll add 2 new divs. Each one for each column.</p><p>In the first column, add a <strong>Post Featured Image</strong> element to have the avatar saved as the post’s featured image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bNzWUDujgswjRObu.png" /></figure><p>Next, we’ll create another div inside this column to contain all the social networks.</p><p>Now, select an <strong>Icon</strong> element to create the social network’s icon. Then, choose the icon’s shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*QkDF14NfoN9Bagof.png" /></figure><p>As the social links are saved in custom fields, we’ll insert the dynamic data into the <strong>Icon</strong> element. To do it, click the icon shown in the image below and choose the right field in the <strong>Metabox</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CcuPyv0Y6Ctyhx36.png" /></figure><p>Take the member’s Facebook profile as an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6vHFY1ZZRibkMGos.gif" /></figure><p>For the Instagram and Mail information, do likewise.</p><p>Move to the second column, to get the name of the member, it’s the post title, so choose the <strong>Heading</strong> element then insert dynamic data for this element by choosing the <strong>Post Title</strong> option in the <strong>Post</strong> section. You see that the member’s name has just been obtained already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3weBy8XaYZiH3L6F.gif" /></figure><p>For the position information, add a <strong>Text</strong> element. As the position is saved in the custom field created by Meta Box, we’ll insert the dynamic data into this element. Also, click the icon as we did before and choose the corresponding field name in the <strong>Metabox</strong> section. Then, you’ll see the member’s position appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*GQ-u22tTjjoP60Eq.gif" /></figure><p>To get a short description of the member, also choose the <strong>Text</strong> element and then choose the <strong>Post Content</strong> option in the <strong>Post</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*c3nu8IxkzjVS1zn9.gif" /></figure><p>We have just displayed all the wanted information from a team member on the name card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*21DVzlNcI-eEz_cb.png" /></figure><h3>Style the Global Block</h3><p>Go back to the created global block. Then, customize each element to get the wanted display.</p><p>After styling, you’ll see the new look of the name card, which contains each team member’s information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*0qBI7nRo9h-L1PDU.png" /></figure><h3>Create the Page</h3><p>Now, create a new page, and edit it with <strong>Breakdance.</strong> First, add a section to contain all the information of the team members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qKDnG64JlUZ5CJX8.png" /></figure><p>Then, add a heading to name it.</p><p>To display the wanted posts, which means for the team members’ information, choose a <strong>Post Loop Builder</strong> element. In the <strong>Global Block</strong> section of this element’s settings, choose the global block which has just been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fptY6P89QdnT_Pk2.png" /></figure><p>To stipulate the source of data and the team members you want to display, go to the <strong>Query</strong> section &gt; <strong>Custom</strong>, then edit the query like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*L64JopHynuhmqzE-.png" /></figure><p><strong>In there</strong>:</p><ul><li>In the <strong>Source</strong> data, it’ll be automatically set as the Post Types, then choose the name of the team members you want to get the post from.</li><li>In the <strong>Post</strong> <strong>per page</strong> section, enter the number to limit the number of posts you want to display on this page.</li></ul><p>After applying the query, the team members’ information has just been obtained.</p><p>Now, I’ll set the layout for this page. Then, all of the team members’ information is displayed as I want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mWXk8BGrKzpBFSlp.png" /></figure><h3>Last Words</h3><p>Is it so easy to create the team members’ page using <strong>Meta Box</strong> and <strong>Breakdance</strong> without coding, right?</p><p>If you think this practice is helpful, try it out and share the results with us. And, don’t forget to follow our channel.</p><p>— — — The publication at <a href="https://metabox.io/create-team-members-page-p6-meta-box-breakdance/">Meta Box</a> — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112da677115d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Menus for Restaurants — P2- Using Meta Box and Bricks]]></title>
            <link>https://medium.com/@wpmetabox/how-to-create-menus-for-restaurants-p2-using-meta-box-and-bricks-b70d13fdea8c?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b70d13fdea8c</guid>
            <category><![CDATA[menu]]></category>
            <category><![CDATA[restaurant]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[custom-fields]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 01:47:17 GMT</pubDate>
            <atom:updated>2023-02-07T01:47:17.385Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create Menus for Restaurants — P2- Using Meta Box and Bricks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8ZEFy49u3F0Jcy9JvpcfA.jpeg" /></figure><p>If you’re having a food ordering service or something similar, there will be a large number of restaurants on your site. Definitely, each restaurant has its own menu and you may want to <strong>create their own menu</strong> for each one. In this practice, we’re going to find out how to do it using <strong>Meta Box </strong>and <strong>Bricks Builder</strong>.</p><p>Here is my example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*wPpBQcT1XDjiBrlb.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/IKezivBoazI">https://youtu.be/IKezivBoazI</a></p><h3>Before Getting Started</h3><p>Normally, we can create a new post type and each dish will be a post of that post type. However, in this case, I want to put dishes into a menu for a particular restaurant. And each restaurant including its information will be displayed on a singular page. So, instead of creating each dish as a separate post of different post type, all the detailed information of the dish in the menu will be saved in custom fields stored in the post containing the restaurants’ information.</p><p>In this practice, we need these tools:</p><ul><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: to have a framework to create custom post type and custom fields;</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Type</a>: to create custom post type for the restaurants;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have a UI on the back end to create custom fields easily;</li><li><strong>Bricks Builder</strong>: to create the page to display the menu.</li></ul><h3>Create a Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong> to create a new post type for the restaurants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UhL4s7UIHRuHjNE3.png" /></figure><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box &gt; Custom Fields</strong> to create fields. I’ll create all the fields with the structure like this:</p><p><strong>NameField typeSettings</strong>Menu DetailsGroup</p><ul><li>Collapsible</li><li>Cloneable</li></ul><p>NameText PriceText DescriptionText ImageSingle Image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*xlDvzQab2dYfUYs0.png" /></figure><p>As you can see from the above image, there is a group with 4 subfields inside. These subfields are for the dish detail. To add more dishes, set this group to be cloneable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lbWESI_YjhTpSsUh.png" /></figure><p>Then, there’ll be an <strong>Add more</strong> button to allow adding more dishes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Fn0spJOPbs98YJ-D.png" /></figure><p>If there are many dishes on the menu, it will be a bit messy. So, to avoid messing up, you can set this group to be collapsible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*FSkYa0ziLJ-STRGu.png" /></figure><p>It’ll be neat when adding information for the menu like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2zM3sDi-9hR7eJXR.png" /></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab &gt; <strong>Location</strong> as <strong>Post type</strong> &gt; select <strong>Restaurant</strong> to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zrnckVgTvylgIILg.png" /></figure><p>Then, you can see all the created fields in the post editor. Just fill in the dishes’ details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*68StxYdo40FuwyCa.png" /></figure><h3>Display the Menu Information</h3><p>I already have a singular page that displays all of the detailed information of a restaurant which is a post in the Restaurant post type with a template below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*0b05ZDxpJ-WjyfFZ.png" /></figure><p>Let’s edit the template of this page with Bricks to add the menu.</p><p>First, to contain all the menu’s information, add a new <strong>Div</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hTN57k1QLSM2rDeY.png" /></figure><p>Next, choose the <strong>Heading</strong> element and name the menu.</p><p>To contain the dishes’ information, add the <strong>Container</strong> element inside the div. Then, to get the data of the dishes, enable the <strong>Use query loop</strong> button. And in the <strong>Query</strong> section, choose the type of data source. Because our information is saved in the custom fields which are included in a clonable group, we should choose the type as <strong>MB Group</strong> along with the name of the group that we have created for the custom field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*q1Flo4Fl_mRJUFbM.png" /></figure><p>To get the dish’s name, choose the <strong>Heading</strong> element. As the name of the dish is saved in the custom field of Meta Box, use the <strong>Select Dynamic data</strong> button and choose the field name in which we store the name of the dishes. Now you can see that the dishes’ names have just been displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rrgAXEuS3gisMyFg.gif" /></figure><p>For the dish’s price, choose the <strong>Basic Text</strong> element. It’s also stored in the created custom field. So, we also use the <strong>Select Dynamic data</strong> button and choose the field correspondingly. Then, you’ll see the dish’s price displayed immediately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Io72Vndc_09WZkxx.gif" /></figure><p>To add the dish’s description, do likewise with the dish’s price. Just duplicate the <strong>Basic Text</strong> element and connect it to the corresponding field to get the right information..</p><p>For the last information — the dish’s image, choose the <strong>Image</strong> element. Since the images are also saved in the custom field as well, choose the <strong>Select Dynamic data</strong> button and select the right field. Here, you see that the dish’s image has just been obtained already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7VfhVRaLvuz3QOVy.gif" /></figure><p>We have just displayed all the wanted information of the dishes.</p><p>Go to the frontend, you’ll see all of the menu information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VlOd8KcKyGPb1Eo-.png" /></figure><h3>Style the Menu</h3><p>Back to the page editor with Bricks Builder. Then, customize each element to style them in your own way. We can add some images to decorate the menu.</p><p>On the frontend, you’ll see the wanted style of the menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*IIDtPJMDZzdvvTG5.png" /></figure><h3>Last Words</h3><p>We have finished creating a menu for a restaurant with simple steps. Hope this practice will give you a hand in creating a new one. Let’s try it and share the result with us.</p><p>Keep an eye on our blog and best wishes!</p><p>— — — The publication at <a href="https://metabox.io/create-menus-for-restaurants-p2-meta-box-bricks/">Meta Box</a> — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b70d13fdea8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Display the Latest Products — P6 — using Meta Box and Breakdance]]></title>
            <link>https://medium.com/@wpmetabox/how-to-display-the-latest-products-p6-using-meta-box-and-breakdance-a9560b0b7a45?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9560b0b7a45</guid>
            <category><![CDATA[latest-posts]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[breakdance]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 31 Jan 2023 01:33:38 GMT</pubDate>
            <atom:updated>2023-01-31T01:41:09.465Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display the Latest Products — P6 — using Meta Box and Breakdance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rWKoINKjJJTZO0-uygvlw.jpeg" /></figure><p>There are various ways to <strong>display the latest products section</strong> using Meta Box and <a href="https://metabox.io/series/latest-products/">page builders</a>. In today’s practice, we’re going to do it using Meta Box and Breakdance.</p><p>I take the restaurants as an example for the posts as well as for the products:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*kBLaB1tcXGIoHAfh.png" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/HrhJUBQA7Uk">https://youtu.be/HrhJUBQA7Uk</a></p><h3>Before Getting Started</h3><p>In this case, my products are restaurants. Each restaurant will be a post in a custom post type and displayed in a box as in the image below. It is created as a global block in Breakdance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*lzw7D5y9e3jSZuDb.png" /></figure><p>In the block, the name of the restaurant and its image are the title and the featured image of the post. Further, you may want to add some extra information for your products, so I have something as a demo, such as logo, address, and voucher. This extra information will be saved in the custom fields created by Meta Box.</p><p>And, in this section, only the 6 latest restaurants will be displayed.</p><p>For this practice, we need these tools:</p><ul><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: to have the framework for creating custom post type and custom fields.</li><li><a href="https://wordpress.org/plugins/mb-custom-post-type/">MB Custom Post Types</a>: to create custom post types for the products;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li><li><strong>Breakdance</strong>: to build the page and create a section to display the latest posts.</li></ul><h3>Create a New Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; New Post Type</strong> to create a new post type for the products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*YXRRd35kVymAcQK-.png" /></figure><h3>Create Custom Fields</h3><p>Each restaurant has extra information, so we’ll create custom fields to save them. Go to <strong>Meta Box &gt; Custom Fields</strong> to create fields. Here are the fields that I’ll create:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Wi-_31H3Jug24GWY.png" /></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab &gt; <strong>Location</strong> &gt; choose <strong>Post Type</strong> as the <strong>Restaurants</strong> post type to apply these fields to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*w77W3OmHEAQ5f3Ey.png" /></figure><p>Go to the post editor, you will see all of the created custom fields.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NRR4L7DSP9J5ra4b.png" /></figure><p>Just fill in the information.</p><h3>Create a Global Block</h3><p>Now, let’s create a global block to get the post information! Go to <strong>Breakdance &gt; Global Blocks</strong> then create a new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XhoxlPQdPLwZIWzM.png" /></figure><p>Remember to set the preview for the global block.</p><p>My global block is to display the information of each post in a box like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*2Rl9Xnce-VILh5zC.png" /></figure><p>First, we’ll add a div for this box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*HjyuoAN_stlOIpAs.png" /></figure><p>Next, add an <strong>Image</strong> element to display the featured image of the post. To insert dynamic data for this element, just click the icon in the image below and choose the <strong>Featured Image</strong> option in the <strong>Post</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*aXsH-Tm9M4MsQf9q.png" /></figure><p>For the restaurant’s name, select a <strong>Text Link</strong> element to display the name in link format. Then, choose the <strong>Post Title</strong> option. And, if you want to set the hyperlink, choose the <strong>Post Permalink</strong> option in the <strong>Link</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*MiG7Ad81bWw5aE9e.gif" /></figure><p>To display the restaurant’s address, add a <strong>Text</strong> element. As the address is saved in the custom field created by Meta Box, we’ll insert the dynamic data into this element. Also, click the icon as we did before and choose the corresponding field name in the <strong>Meta Box</strong> section. Then, the restaurant’s address will be obtained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fRv3T23MgMAqyLBE.gif" /></figure><p>For the voucher information, do likewise.</p><p>For the last one — the logo of the restaurant, we’ll add an <strong>Image</strong> element for it. The logo is saved in the custom field as well, so we’ll also insert the dynamic data into this element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*21NfGdrwRoY5nOr1.gif" /></figure><p>We have just displayed all the wanted information from the restaurant.</p><h3>Add the Section to the Homepage</h3><p>Let’s edit the homepage with Breakdance. First, add a new section to the page to contain all the latest products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*7YJdRw-KJmmfpJFJ.png" /></figure><p>Then, add a heading to name it.</p><p>For displaying the wanted posts, choose a <strong>Post Loop Builder</strong> element. In the <strong>Global Block</strong> section of this element’s settings, choose the global block which has just been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UY3cZPgCMeDOvnXY.png" /></figure><p>To stipulate the source of data and the products you want to display in the section, go to the <strong>Query</strong> section &gt; <strong>Custom</strong> &gt; then edit the query like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UNuW6C8CGIcJ3uBm.png" /></figure><p><strong>In there:</strong></p><ul><li>In the <strong>Source</strong> data, it’ll be automatically set as the <strong>Post Types</strong>, then choose the name of the product you want to get the post from.</li><li>In the <strong>Post per page</strong> section, enter the number to limit the number of posts you want to display in this section.</li><li>In the <strong>Order</strong> section, the query also automatically sets the order by date and descending. It means that the latest post will be displayed first and then the older one. That’s exactly what we want in this practice. So, we just keep this setting by default.</li></ul><p>After applying the query, you’ll see all the latest restaurants appear in the order you want.</p><h3>Style the Section</h3><p>Go back to the created global block. Then, customize each element, and also can add some CSS to the element to get the wanted display.</p><p>After styling the global block, back to the homepage, you’ll see the information of the posts will have a new look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*gf_IiSRy3Y3NodTJ.png" /></figure><p>Next, we’ll set the layout of the section for better display. Go to edit the homepage with Breakdance, and change the setting of each element.</p><p>After that, you’ll see the new appearance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*tgkkPhNt982zvNv3.png" /></figure><h3>Last Words</h3><p>We’ve gone through all the specific steps to display the latest products section using Meta Box and Breakdance.</p><p>Let’s try it out and share the results with us! Thank you for reading!</p><p>— — — The publication at <a href="https://metabox.io/display-latest-products-p6-meta-box-breakdance/">Meta Box</a> — — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9560b0b7a45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Product Page — P4 — Using Meta Box and Elementor]]></title>
            <link>https://medium.com/@wpmetabox/how-to-create-a-product-page-p4-using-meta-box-and-elementor-e9406706381?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9406706381</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[product-page]]></category>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 02:02:10 GMT</pubDate>
            <atom:updated>2023-01-17T02:02:10.794Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a Product Page — P4 — Using Meta Box and Elementor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bFBLO1dHifQiY_nFm5Bsw.jpeg" /></figure><p>Let’s see **how to create a great product page** using **Meta Box** and **Elementor** with some simple steps! I also take a car rental for the product as an example.</p><p>&lt;! — more →</p><p>&lt;img alt=”Example of a product page” height=”594&quot; src=”<a href="https://i.imgur.com/eR5DcdE.png">https://i.imgur.com/eR5DcdE.png</a>&quot; width=”1000&quot;&gt;</p><p>## Video Version</p><p><a href="https://youtu.be/gI0M5nuzPj8">https://youtu.be/gI0M5nuzPj8</a></p><p>## Before Getting Started</p><p>The product page is a singular page. All of its information is saved in a post of a custom post type. The name of the product and its descriptions are the title and content of the post. The remaining detailed information will be saved in the custom fields that are created by **Meta Box**.</p><p>&lt;img alt=”A product page is a singular page” height=”563&quot; src=”<a href="https://i.imgur.com/DaLle8J.png">https://i.imgur.com/DaLle8J.png</a>&quot; width=”1000&quot;&gt;</p><p>So, in this practice, we need these tools:</p><p>* &lt;a href=”<a href="https://wordpress.org/plugins/meta-box/">https://wordpress.org/plugins/meta-box/</a>&quot;&gt;Meta Box core plugin&lt;/a&gt;: to have a framework to create a custom post type and custom fields;<br>* &lt;a href=”<a href="https://metabox.io/plugins/custom-post-type/">https://metabox.io/plugins/custom-post-type/</a>&quot;&gt;MB Custom Post Type&lt;/a&gt;: to create custom post types for the products;<br>* &lt;a href=”<a href="https://metabox.io/plugins/meta-box-builder/">https://metabox.io/plugins/meta-box-builder/</a>&quot;&gt;Meta Box Builder&lt;/a&gt;: to have a UI on the back end to create custom fields easily;<br>* &lt;a href=”<a href="https://metabox.io/plugins/mb-elementor-integrator/">https://metabox.io/plugins/mb-elementor-integrator/</a>&quot;&gt;Meta Box — Elementor Integrator&lt;/a&gt;: to get the dynamic data from custom fields created by Meta Box;<br>* **Elementor** to build the page. I’m using **Elementor Pro**, which has integration with Meta Box.</p><p>## Create a New Custom Post Type</p><p>Go to **Meta Box &amp;gt; Post Types &amp;gt; New Post Type** to create a new custom post type.</p><p>&lt;img alt=”Create a new custom post type” height=”689&quot; src=”<a href="https://i.imgur.com/1UoEKF3.png">https://i.imgur.com/1UoEKF3.png</a>&quot; width=”1000&quot;&gt;</p><p>## Create Custom Fields</p><p>The product has extra detailed information, so we’ll create custom fields to save them. Go to **Meta Box &amp;gt; Custom Fields**, then create fields as you want.</p><p>&lt;img alt=”Create custom fields” height=”753&quot; src=”<a href="https://i.imgur.com/RLzyil1.png">https://i.imgur.com/RLzyil1.png</a>&quot; width=”1000&quot;&gt;</p><p>In my case, I just take a typical example of car rental with some common fields. Here are the fields that I created.</p><p>&lt;img alt=”The created custom fields” height=”800&quot; src=”<a href="https://i.imgur.com/W1deiPo.png">https://i.imgur.com/W1deiPo.png</a>&quot; width=”1000&quot;&gt;</p><p>To know more about the field type, you may have your own specific information for the product. So, you may want to find out each field type to get the matching one. We have a video to talk about &lt;a href=”<a href="https://youtu.be/WWeaM5vIAwM">https://youtu.be/WWeaM5vIAwM</a>&quot;&gt;all the field types of Meta Box&lt;/a&gt; in detail. You can dig into it.</p><p>After creating all fields, move to the **Settings** tab &amp;gt; **Location** &amp;gt; choose **Post Type** as** Car Rental** to apply these fields to this post type.</p><p>&lt;img alt=”Set location for the created custom fields as post type” height=”609&quot; src=”<a href="https://i.imgur.com/I1gm1Oa.png">https://i.imgur.com/I1gm1Oa.png</a>&quot; width=”1000&quot;&gt;</p><p>In the post editor, you will see all of the created custom fields.</p><p>&lt;img alt=”All created fields in the post editor” height=”790&quot; src=”<a href="https://i.imgur.com/SjBBCpL.png">https://i.imgur.com/SjBBCpL.png</a>&quot; width=”1006&quot;&gt;</p><p>## Create a Template</p><p>Go to the **Elementor Theme Builder** and create a new template. Since it’s for a singular page of a custom post type, we’ll create it in the type of a single post.</p><p>&lt;img alt=”Create a template” height=”366&quot; src=”<a href="https://i.imgur.com/yyXmCoo.png">https://i.imgur.com/yyXmCoo.png</a>&quot; width=”1000&quot;&gt;</p><p>After setting the preview for the template, let’s edit it.</p><p>My product page has two columns like this:</p><p>&lt;img alt=”Two columns of the product page” height=”401&quot; src=”<a href="https://i.imgur.com/YcW9Ksx.png">https://i.imgur.com/YcW9Ksx.png</a>&quot; width=”1000&quot;&gt;</p><p>So, first, add a widget and choose the layout for it.</p><p>&lt;img alt=”Add a widget and choose the layout” height=”561&quot; src=”<a href="https://i.imgur.com/qgwzmNm.png">https://i.imgur.com/qgwzmNm.png</a>&quot; width=”1000&quot;&gt;</p><p>In the first column, select the **Image Carousel** to display the image gallery as a slider. Then, to get the image that is saved in the custom field, go to the **Dynamic Tags**, find the **Meta Box Field** in the **Post** section, and choose the field that is set for the image. After that, you can see all of the images appear</p><p>&lt;img alt=”Find the corresponding field to get the data by using Dynamic Data” height=”563&quot; src=”<a href="https://i.imgur.com/RkfR1jo.gif">https://i.imgur.com/RkfR1jo.gif</a>&quot; width=”1000&quot;&gt;</p><p>Move to the second column to display other information about the product. The first one is the product’s name which is saved in the post title. So, choose the **Post Title** element &amp;gt; select the **Post Content** element to get the product’s description.</p><p>&lt;img alt=”Choose the post title element for the product’s description” height=”379&quot; src=”<a href="https://i.imgur.com/3uJDuKv.png">https://i.imgur.com/3uJDuKv.png</a>&quot; width=”1000&quot;&gt;</p><p>For the rental price information, choose the **Text Editor** element. Since the rental price is saved in custom fields created by Meta Box, also use the **Dynamics Tags &amp;gt; Meta Box Field** in the **Post** section &amp;gt; choose the corresponding fields. A number will be displayed without a unit of the pricing.</p><p>&lt;img alt=”Choose the Text Editor element for the rental price information” height=”563&quot; src=”<a href="https://i.imgur.com/JKWxASC.gif">https://i.imgur.com/JKWxASC.gif</a>&quot; width=”1000&quot;&gt;</p><p>To have the unit displayed, go to the **Advanced** section, and add the currency unit.</p><p>&lt;img alt=”Add the currency unit in the Advanced section” height=”397&quot; src=”<a href="https://i.imgur.com/M9prrn2.png">https://i.imgur.com/M9prrn2.png</a>&quot; width=”1000&quot;&gt;</p><p>For the rest of the information in this section, they have the same style with 2 columns. The first one is the title, and the second one is the information that is obtained from the custom fields.</p><p>&lt;img alt=”The rest of the information will have the same style with 2 columns” height=”404&quot; src=”<a href="https://i.imgur.com/SDHPQ9D.png">https://i.imgur.com/SDHPQ9D.png</a>&quot; width=”1000&quot;&gt;</p><p>Thus, we’ll use the **Inner Section** with 2 columns as well for each row.</p><p>&lt;img alt=”Use the Inner Section with 2 columns” height=”563&quot; src=”<a href="https://i.imgur.com/quyDxUW.png">https://i.imgur.com/quyDxUW.png</a>&quot; width=”1000&quot;&gt;</p><p>&lt;img alt=”2 columns for each row” height=”559&quot; src=”<a href="https://i.imgur.com/HDkwhM1.png">https://i.imgur.com/HDkwhM1.png</a>&quot; width=”1000&quot;&gt;</p><p>The first column is the title. So, select the **Heading** element, then just name and style it.</p><p>&lt;img alt=”Select the Heading element for the title” height=”561&quot; src=”<a href="https://i.imgur.com/uSpRUnR.png">https://i.imgur.com/uSpRUnR.png</a>&quot; width=”1000&quot;&gt;</p><p>In the second column in the **Inner Section** element, add a **Text Editor** element, then connect it to the custom field to get the data using the dynamic tags. Take **Car Year** as an example.</p><p>&lt;img alt=”Add a Text Editor element in the Inter Section element then connect it to the right field” height=”563&quot; src=”<a href="https://i.imgur.com/dsNR88Q.gif">https://i.imgur.com/dsNR88Q.gif</a>&quot; width=”1000&quot;&gt;</p><p>You can duplicate the **Inner Section** to have other rows and change the information to get the right one.</p><p>After getting all of the information about the product, remember to set the condition for this template to apply it to the singular page of the **Car Rental**.</p><p>&lt;img alt=”Set the condition for the template” height=”559&quot; src=”<a href="https://i.imgur.com/ykzuUrs.png">https://i.imgur.com/ykzuUrs.png</a>&quot; width=”1000&quot;&gt;</p><p>Now, in the frontend, all of the product’s detailed information is displayed.</p><p>&lt;img alt=”All the product’s information is displayed” height=”588&quot; src=”<a href="https://i.imgur.com/Ije0Xxw.png">https://i.imgur.com/Ije0Xxw.png</a>&quot; width=”1000&quot;&gt;</p><p>## Style the Page</p><p>Still in the editor of the created template, just customize each element to get the wanted style.</p><p>&lt;img alt=”Style the Page” height=”471&quot; src=”<a href="https://i.imgur.com/Nek1KHd.png">https://i.imgur.com/Nek1KHd.png</a>&quot; width=”1000&quot;&gt;</p><p>After styling, you’ll see the new look.</p><p>&lt;img alt=”The final result after styling” height=”594&quot; src=”<a href="https://i.imgur.com/eR5DcdE.png">https://i.imgur.com/eR5DcdE.png</a>&quot; width=”1000&quot;&gt;</p><p>## Last Words</p><p>Hopefully, all the following steps above can give you a hand in creating a detailed product page. If you use other page builders, you can dig into &lt;a href=”<a href="https://metabox.io/series/product-page/">https://metabox.io/series/product-page/</a>&quot;&gt;the series on how to create a product page with different page builders&lt;/a&gt;.</p><p>If you want to suggest any tutorials, feel free to leave a comment. Thank you for reading. Good luck!<br> <br> — — — The publication at <a href="https://metabox.io/create-product-page-p4-meta-box-elementor/">Meta Box </a>— — —</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9406706381" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Filter Posts by Custom Fields — P2 — using Meta Box and FacetWP]]></title>
            <link>https://medium.com/@wpmetabox/how-to-filter-posts-by-custom-fields-p2-using-meta-box-and-facetwp-6c95bd233bfd?source=rss-225304e166e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c95bd233bfd</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[custom-fields]]></category>
            <category><![CDATA[dynamic-data]]></category>
            <category><![CDATA[filters]]></category>
            <dc:creator><![CDATA[WP Meta Box Plugin]]></dc:creator>
            <pubDate>Tue, 10 Jan 2023 02:24:59 GMT</pubDate>
            <atom:updated>2023-01-10T02:24:59.354Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Filter Posts by Custom Fields — P2 — using Meta Box and FacetWP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRdYluIkWARHu4EweA0FoA.jpeg" /></figure><p>On an archive page, we’ll display posts and filter them by the values stored in the custom fields created by Meta Box. With the help of <strong>FacetWP</strong>, we can do it easily without coding.</p><p>Here is an archive that I created for example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BSCnqoP2HoT3Jks9.gif" /></figure><h3>Video Version</h3><p><a href="https://youtu.be/kjkVaC_QKQs">https://youtu.be/kjkVaC_QKQs</a></p><h3>Before Getting Started</h3><p>On the page, we’ll have 2 sections. One is used to filter the restaurants by conditions. We’ll create this part using <strong>FacetWP</strong>. The second part is to show up all the restaurants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*GQa4s8I4kQnwWeYt.png" /></figure><p>All the information of the restaurants is saved in a custom post type. Each restaurant is a post of that post type. Besides the basic information such as name and image of the restaurants which are the post title and featured images, other additional information will be saved in different custom fields.</p><p>In the upcoming execution, we’ll create them one by one. No matter if you’re using any page builder or not, you can also use <strong>FacetWP</strong> to filter posts as I’m doing in this practice. In this case, I chose <strong>Elementor</strong> to build the page and use the pro version.</p><p>For the custom fields, we need<a href="https://wordpress.org/plugins/meta-box/"> Meta Box core plugin</a> and some of its extensions, including:</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: to create custom post type;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: to have an intuitive UI to create custom fields in the backend;</li><li><a href="https://metabox.io/plugins/meta-box-facetwp-integrator/">Meta Box — FacetWP Integrator</a>: to create a filter based on the custom fields;</li><li><a href="https://metabox.io/plugins/mb-elementor-integrator/">Meta Box Elementor Integrator</a>: to connect and display custom fields created by Meta Box in the <strong>Elementor</strong>’s dynamic tags.</li></ul><h3>Create a Custom Post Type</h3><p>Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong> to create a new post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*6M6Ss-DF5Su98I6E.png" /></figure><p>After publishing, we’ll have a new <strong>Restaurants</strong> menu in the admin dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*0VEvChe4eofzztC9.png" /></figure><p>Then, let’s create custom fields to save restaurants’ information in the next step.</p><h3>Create Custom Fields</h3><p>Go to <strong>Meta Box &gt; Custom Fields</strong> to create a new field group. Here are the field that I created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3vLnX2RXjavSjiOz.png" /></figure><p>For the <strong>Voucher</strong> information, choose the <strong>Checkbox list</strong> field to allow adding some options in the <strong>Choices</strong> box. These options will be used as a condition to filter posts when creating a filter section in the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*KIPdgxvuy5knCxLq.png" /></figure><p>After creating all the needed fields, move to the <strong>Settings</strong> tab, choose <strong>Location</strong> as <strong>Post Type</strong> and select <strong>Restaurant</strong> to apply these fields to this post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*y0eg4rH8mHOH53fr.png" /></figure><p>When creating a new post in Restaurant post type, you’ll see all the created custom fields:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EpOrEPnA-QCtAhKy.png" /></figure><h3>Create a Template</h3><p>Depending on the page builder you’re using, there will be some differences in the creating page and template. You may need to create a template for the page or edit the page directly.</p><p>In this case, with <strong>Elementor</strong>, we need to create one. This template is to display all the posts along with their information. About the filter section, we’ll create it later.</p><p>Since we’ll have a list of restaurants on the page, we need a special type of template which is a loop. This option is provided by <strong>Elementor Custom Skin</strong>. You can try it.</p><p>Go to <strong>Templates</strong> &gt; <strong>Theme Builder</strong> and choose <strong>Loop.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*pNfQj7aVwBLiA3Ls.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fAeMGdt121VZ1abH.png" /></figure><p>Remember to set the preview for the template.</p><p>Since the image and name of the restaurants are the featured image and title of the post, add the <strong>Featured Image</strong> and <strong>Post Title</strong> elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Usg2beKRTuOl-n0h.png" /></figure><p>For the address of the restaurant, add the <strong>Text Editor</strong> element. Since the restaurants’ addresses are saved in a custom field created by Meta Box and the custom field is for post, let’s use the <strong>Dynamic Tags</strong> &gt; choose <strong>Meta Box Fields</strong> in the <strong>Post</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*un5lNiPyU_c0b-ej.png" /></figure><p>And then, select the corresponding field. In this case, it’s <strong>Address</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*-pb5lKcQuygqHhKS.png" /></figure><p>For the voucher information, do likewise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ecAtYvh6FBWYZ0-h.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*RMmCZNngchB51tu6.png" /></figure><p>Now, all the restaurant’s information has been displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*zCi9t2hBF1xFVvwx.png" /></figure><p>Save the template and remember to set the condition to apply this template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ye5Oqy_MPGBkWf9T.png" /></figure><h3>Create the Page</h3><p>Go to <strong>Pages</strong> to create a new page and <strong>edit it with Elementor.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*exEAcNYsy0kGjmWX.png" /></figure><p>Add the <strong>Posts</strong> element to the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Qdb-W_Omcy1AiKnN.png" /></figure><p>In the <strong>Skin</strong> setting of the <strong>Posts</strong> element, choose <strong>Custom</strong> and then select the default template as the one we’ve just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Dbjo04ZmJJu8CCTf.png" /></figure><p>Next, go to the <strong>Query</strong> section, choose the source as the post type you want. In this case, it’s <strong>Restaurant</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*HROZ8zj8VILIqYyK.png" /></figure><p>Now, the preview shows all the posts with the information as we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*8ywPj2wyQzyHWcfd.png" /></figure><p>Let’s see how to add a filter section in the next step.</p><h3>Add Filter</h3><p>This task will be done by <strong>FacetWP</strong>. If you use other page builders, you can also create the filter as I’m doing in this practice.</p><p>In the admin dashboard, go to <strong>Settings</strong> and choose <strong>FacetWP</strong> to create a new filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1AB5lvHZoEMUVklX.png" /></figure><p>Since we will filter the post by the promotion of the restaurant which is saved in the <strong>Voucher</strong> field, choose the <strong>Data Source</strong> as <strong>Voucher</strong> in the <strong>Restaurant</strong> post type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dxE77ktu0qEutxbP.png" /></figure><p>Save the changes and copy the shortcode of the facet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*GflkwzBJskNHJuTs.png" /></figure><p>Then, go back to the created page editor with <strong>Elementor</strong>, add a <strong>Shortcode</strong> element to paste the code we’ve just copied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BZk4PnKNNM15SRi0.png" /></figure><p>After applying the code, you’ll see a section to filter posts in the frontend. All the restaurants having the same coupons are filtered correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*eIvC2QTtjkPZYeAn.gif" /></figure><h3>Style the Page</h3><p>Go back to the template of the page, you can style each element as you want.</p><p>In the event that you want to have more further styling, you can use some CSS code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*vwo2iv5SRocT-UYt.png" /></figure><p>All the changes in style will be applied immediately. This is how it looks on the frontend. The filter section created by <strong>FacetWP</strong> works well and all the posts have been filtered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*wl_Mp_zeRWaYL2c4.gif" /></figure><h3>Last Words</h3><p>Using custom fields with the help of <strong>FacetWP</strong> is a brilliant way to create conditions and filter posts. If you see this practice is helpful, try it out and share the result with us. If you want to suggest any ideas, feel free to let us know by leaving a comment. Good luck!</p><p>___The publication at <a href="https://metabox.io/filter-posts-by-custom-fields-p2-facetwp/">Meta Box</a>___</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c95bd233bfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>