<?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[Meta Box - Medium]]></title>
        <description><![CDATA[WordPress Custom Fields Framework - Medium]]></description>
        <link>https://medium.com/meta-box?source=rss----168d1c9db6bd---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Meta Box - Medium</title>
            <link>https://medium.com/meta-box?source=rss----168d1c9db6bd---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 19:38:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/meta-box" 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 Display Images from Cloneable Fields — P1 — with Gutenberg]]></title>
            <link>https://medium.com/meta-box/how-to-display-images-from-cloneable-fields-p1-with-gutenberg-e2517d26383a?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/e2517d26383a</guid>
            <category><![CDATA[gutenberg]]></category>
            <category><![CDATA[cloneable]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[meta-box]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 02:31:12 GMT</pubDate>
            <atom:updated>2022-02-22T02:31:11.719Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display Images from Cloneable Fields — P1 — with Gutenberg</h3><figure><img alt="How to Display Images from Cloneable Fields — P1 — with Gutenberg" src="https://cdn-images-1.medium.com/max/1000/0*FzNZ6_nsBpfdBA1Y.jpg" /></figure><p><strong>Display images from cloneable fields</strong> is a common task for those who are building a website. For example, you may want to <strong>display a series of brand logos</strong> of typical clients or partners, even a testimonial section with an avatar along with the clients’ name and quote. In this series, we will take a ride to do it with a simple case study, brand logos.</p><figure><img alt="The example of displaying images from cloneable fields using Meta Box + Gutenberg" src="https://cdn-images-1.medium.com/max/1024/0*p83BaszlbGl8-Smj.gif" /></figure><p>If you are using Gutenberg, this part is for you. For other page builders, please wait for the upcoming tutorials.</p><h3>Before Getting Started</h3><p>We’ll need <a href="https://wordpress.org/plugins/meta-box/">Meta Box</a> and some of its extensions for this practice:</p><ul><li><a href="https://metabox.io/plugins/mb-settings-page/">MB Settings Page</a>: it helps you to create settings pages, we’ll need a settings page to place the custom fields into;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: it provides a UI to create custom fields easily;</li><li><a href="https://metabox.io/plugins/meta-box-group/">Meta Box Group</a>: this extension helps to organize custom fields into cloneable groups, where we input images today;</li><li><a href="https://metabox.io/plugins/mb-views/">MB Views</a>: it helps you to create templates as well as get and display fields’ values without touching the theme’s files.</li></ul><p>You can install these extensions individually or use Meta Box AIO.</p><h3>Video Version</h3><p><a href="https://www.youtube.com/watch?v=nteLH6DDKSI">https://www.youtube.com/watch?v=nteLH6DDKSI</a></p><h3>Step 1: Create a Settings Page</h3><p>Normally, we’ll create a Custom Post Type to create multiple posts for brands then each post is for a brand. But, today, I do a more convenient and simple way — creating a <strong>Settings Page</strong>. The information about all the brands will be input to that page. It means that all of them will be in one place only.</p><p>Now, go to <strong>Meta Box</strong> &gt; <strong>Settings Page</strong> &gt; <strong>Add New</strong>. In this case, the <strong>Settings Page</strong> is quite simple to contain the image of each brand, so just change the option name.</p><figure><img alt="Create a Settings Page" src="https://cdn-images-1.medium.com/max/1000/0*9DtynSbBVEgWwAE9.png" /></figure><p>Now, a new menu named <strong>Brands</strong> appears. It’s my new <strong>Settings Page</strong>.</p><figure><img alt="The new Settings Page named Brands appears." src="https://cdn-images-1.medium.com/max/1000/0*mxT4gGL_FkDCPF7w.png" /></figure><h3>Step 2: Create Custom Fields for the Settings Page</h3><p>In the Admin Dashboard, go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong> &gt; <strong>Add New</strong>.</p><p>This is a group with three sub-fields inside. This group is set to be cloneable to have more spaces to add different brands information.</p><figure><img alt="Set this group as cloneable to have more spaces to add different brands information." src="https://cdn-images-1.medium.com/max/1000/0*tfjIsRQhiez28Z7j.png" /></figure><p>As you can see in the structure, I added 2 fields which are <strong>Single Image</strong> and <strong>Url</strong>. One allows you to upload images and save them in the library, and one allows you to input a link of an image from anywhere.</p><figure><img alt="2 fields which are Single Image and Url help you upload images and input a link of image." src="https://cdn-images-1.medium.com/max/1000/0*H0my5eeBr0XXzXMM.png" /></figure><p>After having all the needed fields, go to the <strong>Settings</strong> tab and choose the <strong>Location</strong> as the <strong>Settings Page</strong> that we’ve just created to apply the custom fields to it.</p><figure><img alt="In the Settings tab, choose the Location as the Settings Page that we’ve just created to apply the custom fields." src="https://cdn-images-1.medium.com/max/1000/0*QmsDiOxeyw_ZD5eg.png" /></figure><p>Back to the <strong>Settings Page</strong>, you’ll see all of the created custom fields. You can click <strong>Add more</strong> to add another brand’s information.</p><figure><img alt="The created custom fields are displayed." src="https://cdn-images-1.medium.com/max/1024/0*-Xp9J8526wB-YXVQ.gif" /></figure><p>Now, let’s fill the information into the fields and move to the next step.</p><h3>Step 3: Display Brands Information</h3><p>To display the brand information, you normally must go to the theme’s files to add code or use a page builder. However, you have another way with Meta Box. We have the <strong>MB Views</strong> extension to create templates without touching the theme’s files.</p><figure><img alt="In the Template tab, you can insert fields to get their data." src="https://cdn-images-1.medium.com/max/1000/0*uynkTUp2e33LobE3.png" /></figure><p>Instead of typing code into the box in the <strong>Template</strong> tab, you can insert fields to get their data. And, in the previous tutorial, we used to create custom fields for posts, so we choose one from the <strong>Post</strong> tab. But, in this practice, we created custom fields for the <strong>Settings Page</strong>, so we go to the <strong>Site</strong> tab then find the custom fields that I created.</p><figure><img alt="In Site tab, find the custom fields that I created for the Settings Page." src="https://cdn-images-1.medium.com/max/1000/0*xoQWIKI1ETodYu9S.png" /></figure><p>Because this group is cloneable so whenever you open the group here to find any field, it will auto-generate a Loop.</p><figure><img alt="A Loop is auto generated whenever you open the group to find any field." src="https://cdn-images-1.medium.com/max/1000/0*7NYctqQ-PH42HVS-.png" /></figure><p>When inserting the fields, I also edit the code a little bit to create a rule for displaying images.</p><figure><img alt="Edit the code a little bit to create a rule for displaying images." src="https://cdn-images-1.medium.com/max/1000/0*0mitgodUc-6kquUb.png" /></figure><p>The first part is to set a rule that if there is no URL input to the <strong>URL</strong> field, the value from the <strong>Single Image</strong> field will be obtained and displayed.</p><figure><img alt="Get the value from the Single Image field when the URL field is empty." src="https://cdn-images-1.medium.com/max/1000/0*jurZ6loZiGQWkSgc.png" /></figure><p>When you insert the logo from the <strong>Single Image</strong> field, you can choose to size to output. Here I set it to be the thumbnail.</p><figure><img alt="Set logo size as thumbnail." src="https://cdn-images-1.medium.com/max/1000/0*29U56gjFE3QQx7Hj.png" /></figure><p>In the event that there is no input data in the <strong>Brand Logo Upload</strong> field, the image from the link in the <strong>URL</strong> field will be displayed.</p><figure><img alt="Get the value from the URL field when the Single Image field is empty." src="https://cdn-images-1.medium.com/max/1000/0*3tdBzzf07P8xWYjw.png" /></figure><p>If there is data in both the <strong>Image Upload</strong> and <strong>URL</strong> field, I set priority to display the image of the <strong>Brand Logo Upload</strong> field.</p><figure><img alt="We display the image of the Brand Logo Upload field if both the Image Upload and URL field have the value." src="https://cdn-images-1.medium.com/max/1000/0*JM0b4tnKokMcKDVY.png" /></figure><p>If you have any further information for the brand, such as the <strong>Brand Name</strong> I have in this case, remember to insert them in the next lines.</p><figure><img alt="Get the value of Brand Name field." src="https://cdn-images-1.medium.com/max/1000/0*cVMHPY3FChumagi1.png" /></figure><p>If you want to style this section, add some <strong>div</strong> tags. I also did it and here is all the code.</p><pre>&lt;div class=&quot;brand-group&quot;&gt;<br>{% for clone in site.brands.brand_group %}<br>    &lt;div class=&quot;brand-img&quot;&gt;<br>    {% if clone.brand_logo_url|trim is empty %}<br>        &lt;img src=&quot;{{ clone.brand_logo_upload.thumbnail.url }}&quot; width=&quot;{{ clone.brand_logo_upload.thumbnail.width }}&quot; height=&quot;{{ clone.brand_logo_upload.thumbnail.height }}&quot; alt=&quot;{{ clone.brand_logo_upload.thumbnail.alt }}&quot;&gt;<br>    {% elseif clone.brand_logo_upload.thumbnail.ID|trim is empty %}<br>        &lt;img src=&quot;{{ clone.brand_logo_url }}&quot;&gt;<br>    {% else %}<br>        &lt;img src=&quot;{{ clone.brand_logo_upload.thumbnail.url }}&quot; width=&quot;{{ clone.brand_logo_upload.thumbnail.width }}&quot; height=&quot;{{ clone.brand_logo_upload.thumbnail.height }}&quot; alt=&quot;{{ clone.brand_logo_upload.thumbnail.alt }}&quot;&gt;<br>    {% endif %}<br>    &lt;p class=&quot;name&quot;&gt;<br>        {{ clone.brand_name }}<br>    &lt;/p&gt;<br>    &lt;/div&gt;<br>{% endfor %}<br>&lt;/div&gt;</pre><p>To finish, move to the <strong>Settings</strong> section, choose the type of view as <strong>Shortcode</strong>.</p><figure><img alt="Choose the type of view as Shortcode in Settings section." src="https://cdn-images-1.medium.com/max/1000/0*esGo6-62dl1ADEie.png" /></figure><p>After publishing this view, a shortcode will be generated automatically. You can copy and paste it to any page you want to display the template.</p><p>So, you can see all of the brand logos along with their names displayed already. But this section hasn’t looked good yet. Thus, we’ll need some JS and CSS to make it look better.</p><h3>Step 4: Create Slider for the Brand Logos</h3><p>As you see in the first image I put at the beginning of this post, the logos are in a slider, and brand names are displayed correspondingly. To have it, I’ll use some JS and CSS.</p><p>However, I’m using the <strong>My Custom Functionality</strong> plugin instead of adding them directly to the theme. Thanks to that, the slider won’t be affected when I change the theme. You can download this plugin from <a href="https://github.com/srikat/my-custom-functionality">GitHub</a> and install it on your website.</p><h3>Download the JS and CSS Library</h3><p>For the JS and CSS, I use the Slick library. It’s also available on <a href="https://github.com/kenwheeler/slick">Github</a>. It includes several files, but we just need three of them.</p><figure><img alt="JS and CSS files in the Slick library." src="https://cdn-images-1.medium.com/max/1000/0*W1tWa4imul4jxY4s.png" /></figure><p>Go to the folder of the <strong>My Custom Functionality</strong> plugin. Upload them into the corresponding JS and CSS folders.</p><figure><img alt="Add code in the plugin.php file" src="https://cdn-images-1.medium.com/max/1000/0*FzxFSIyQqRaefJYN.png" /></figure><h3>Create Custom JS for Slider and Rules</h3><p>Create a custom.js file in the JS folder, and add code.</p><figure><img alt="Add code to custom.js file." src="https://cdn-images-1.medium.com/max/1000/0*DV4YUbUzAaSyCNge.png" /></figure><pre>jQuery(document).ready(function ($) {<br>    jQuery(&quot;.brand-group&quot;).slick({<br>        infinite: false,<br>        dots: false,<br>        autoplay: false,<br>        speed: 800,<br>        autoplaySpeed: 4000,<br>        slidesToShow: 7,<br>        slidesToScroll: 7,<br>        nextArrow: &#39;&lt;button class=&quot;next-btn&quot;&gt;Next&lt;/button&gt;&#39;,<br>        prevArrow: &#39;&lt;button class=&quot;prev-btn&quot;&gt;Previous&lt;/button&gt;&#39;<br>    });<br>})</pre><p>jQuery(&quot;.brand-group&quot;).slick({ }) is used to create a slider for the elements which have .brand-group class.</p><h3>Declare the JS and CSS Files</h3><p>We need to declare all the JS and CSS files that we have just uploaded and created. I add this code inside the custom_enqueue_files() function in the plugin.php file.</p><pre>wp_enqueue_style(&#39;slick&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick.css&#39;);<br>wp_enqueue_style(&#39;slick-theme&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick-theme.css&#39;);</pre><pre>wp_enqueue_script(&#39;custom&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/custom.js&#39;, [&#39;jquery&#39;]);<br>wp_enqueue_script(&#39;slick-min&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/slick.min.js&#39;, [&#39;jquery&#39;]);</pre><figure><img alt="Add code in the plugin.php file" src="https://cdn-images-1.medium.com/max/1000/0*wnBF-ly5cF4Bf-DE.png" /></figure><p>Now, the brand images have already turned into a slider.</p><figure><img alt="The brand images have already turned into a slider." src="https://cdn-images-1.medium.com/max/1024/0*Jp_o3iKYmYgD8PxW.gif" /></figure><p>We still need to add some CSS to make it look better.</p><h3>Step 5: Style the Slider using CSS</h3><p>Traditionally, you have to add CSS to the Customizer or the theme’s files. But, with <strong>MB Views</strong>, you have a <strong>CSS</strong> tab for it.</p><figure><img alt="Add code to CSS tab." src="https://cdn-images-1.medium.com/max/1000/0*n1WvNXl5VhoHqVbj.png" /></figure><p>All the CSS code is uploaded to <a href="https://github.com/wpmetabox/tutorials/blob/effb1b8d4729da57bf3fe5ee77dc2fe2827678a7/display-images-from-cloneable-fields-with-Gutenberg/custom.css">Github</a>, you can refer to it.</p><p>After adding CSS, my brand section turned into a new look.</p><figure><img alt="After adding CSS, the brand logos section turned into a new look." src="https://cdn-images-1.medium.com/max/1024/0*NXGzxsdZXIWKyL-2.gif" /></figure><h3>Last Words</h3><p>You see that <strong>displaying images from cloneable fields using Meta Box</strong> is not a difficult task. In my opinion, it’s very practical in some cases. We hope that this tutorial will help you to do it easier.</p><p>Remember to keep track of our channel for more upcoming tuts and feel free to leave a comment if you have any ideas or concerns.</p><p>— — —</p><p>The publication at <a href="https://metabox.io/display-images-from-cloneable-fields-p1-gutenberg/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2517d26383a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-display-images-from-cloneable-fields-p1-with-gutenberg-e2517d26383a">How to Display Images from Cloneable Fields — P1 — with Gutenberg</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Display Opening Hours for Restaurants — P1 — Using Meta Box + Gutenberg]]></title>
            <link>https://medium.com/meta-box/how-to-display-opening-hours-for-restaurants-p1-using-meta-box-gutenberg-7ff7a1d4e962?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/7ff7a1d4e962</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[opening]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[hour]]></category>
            <category><![CDATA[gutenberg]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Wed, 09 Feb 2022 06:03:08 GMT</pubDate>
            <atom:updated>2022-02-09T06:03:05.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display Opening Hours for Restaurants — P1 — Using Meta Box + Gutenberg</h3><figure><img alt="How to Display Opening Hours for Restaurants — P1 — Using Meta Box + Gutenberg" src="https://cdn-images-1.medium.com/max/1000/0*FuNVxwIea60_FCfT.jpg" /></figure><p>Each restaurant or business will have different opening hours. To have that information and display them for each on a website, there might be some techniques including using custom fields. We’re going to <strong>add an Opening Hours section into the single restaurant page</strong> in this tutorial as this example:</p><figure><img alt="The example of adding an Opening Hours section into the single restaurant page." src="https://cdn-images-1.medium.com/max/1000/0*6tt7FgYfgLy_xEFf.png" /></figure><h3>Before Getting Started</h3><p>For having extra information such as time slots for each day, we’ll use custom fields. So, we need the <a href="https://metabox.io/">Meta Box plugin</a> to have a framework to create them. It’s free and available on <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>. Furthermore, we also need some advanced features from Meta Box that are available in the following extensions:</p><ul><li><a href="https://metabox.io/plugins/mb-views/">MB Views</a>: a premium extension of Meta Box. It helps you create templates and display the custom fields’ value on the frontend without touching the theme’s files;</li><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/">MB Group</a>: this extension helps to arrange fields into groups;</li><li><a href="https://metabox.io/plugins/meta-box-conditional-logic/">MB Conditional Logic</a>: this premium extension allows you to create rules to control the display of the fields.</li></ul><p>After installing and activating all these plugins, let’s move to the how-to parts right now.</p><h3>Video Tutorial</h3><p><a href="https://youtu.be/8nZwyBbAWXU">https://youtu.be/8nZwyBbAWXU</a></p><h3>Step 1: Create Custom Fields</h3><p>Normally, we will create a new custom post type for the restaurants first. I skipped that step since I already had it on my website. If you haven’t had it yet, create it first then go to this step.</p><p>Go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong> &gt; <strong>Add New</strong> to create a new field group. Then, add custom fields.</p><p>The first field is a select field and there are 3 options that I filled in the <strong>Choice</strong> box as below.</p><figure><img alt="Fill in the Choice box for the select field." src="https://cdn-images-1.medium.com/max/1000/0*cM1E5Ir8Mv2dPcAh.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="Set conditional logic for the All days have the same opening hours group." src="https://cdn-images-1.medium.com/max/1000/0*7_Ad9mdKChai-VVu.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 all_days_are_the_same.</p><p>Similarly, if the <strong>Choose an Option</strong> field is chosen as the <strong>Difference between weekdays and weekend</strong> options, 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><p>In each group field, I also have subfields with the same structure.</p><p>The <strong>Type of Opening Hours</strong> field is the 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><p>If the restaurant has different opening hours, you can choose <strong>Enter Hours</strong> to display <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="Set the rule when the restaurant has different opening hours." src="https://cdn-images-1.medium.com/max/1000/0*b-CCjnONih-nYI6m.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="In case the restaurant opens in multiple time slots, choose cloneable" src="https://cdn-images-1.medium.com/max/1000/0*2i7jXZNVM_x4PFqs.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><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="The custom fields are displayed." src="https://cdn-images-1.medium.com/max/1024/0*nMS8SsobM5waAxNM.gif" /></figure><p>They work exactly like the rule we set.</p><h3>Step 2: Display the Fields’ Value on the Frontend</h3><p>In this step, we’ll get the input data from those custom fields to display into the Restaurant single page. To do it, we’ll use <a href="https://metabox.io/plugins/mb-views/">MB Views</a> in order not to touch the theme’s file.</p><p>If you’ve had a template created by MB Views for the Restaurant single page already, just go to it and edit. If not, create one. Then, add code to the view.</p><p>The code is quite long, so I put it in my Github <a href="https://github.com/wpmetabox/tutorials/tree/master/showing-opening-hours-section-with-MB-Views">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;div class=&quot;opening-hours&quot;&gt;<br>&lt;h2&gt;<br>    Opening Hours<br>&lt;/h2&gt;<br>&lt;div class=&quot;detail-schedule&quot;&gt;<br>    {% set options = post.choose_an_options.value %}<br>    {% if (options == &quot;all_days_are_the_same&quot;) %}<br>        {% set same_days = post.all_days_have_the_same_opening_hours.type_of_opening_hours.value %}<br>        {% if ( same_days == &quot;enter_hours&quot;) %}<br>        &lt;div class=&quot;date-time&quot;&gt;<br>            &lt;div class=&quot;date&quot;&gt;<br>                Mon - Sun<br>            &lt;/div&gt;<br>            &lt;div class=&quot;hour&quot;&gt;<br>            {% for clone in post.all_days_have_the_same_opening_hours.choose_time_slots %}<br>            &lt;div class=&quot;time-slot&quot;&gt;<br>                &lt;p class=&quot;starting-hour&quot;&gt;<br>                    {{ clone.start_time | date( &#39;h:i A&#39; ) }}<br>                &lt;/p&gt;<br>                &lt;p class=&quot;ending-hour&quot;&gt;<br>                    {{ clone.end_time | date( &#39;h:i A&#39; ) }}<br>                &lt;/p&gt;<br>            &lt;/div&gt;<br>            {% endfor %}<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>    {% else %}<br>    &lt;div class=&quot;date-time&quot;&gt;<br>        &lt;div class=&quot;date&quot;&gt;<br>            Mon - Sun<br>        &lt;/div&gt;<br>        &lt;div class=&quot;hour&quot;&gt;<br>            {{ post.all_days_have_the_same_opening_hours.type_of_opening_hours.label }}<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>    {% endif %}</pre><p>Here I created a variable named <strong>options</strong> to admit the value from the <strong>Choose an Option</strong> field. Then I set a rule based on its value to display values from the subfield in the corresponding group. It’s quite the same with the rules we created when configuring the fields.</p><p>First, if its value is all_day_are_the_same, the values of fields in the <strong>All days have the same opening hours</strong> group will be displayed.</p><figure><img alt="Get the value of field in All days have the same opening hours group." src="https://cdn-images-1.medium.com/max/1000/0*63JATQ24hpCQDrTC.png" /></figure><p>I set a variable named same_days to admit the value from the <strong>Type of Opening Hours</strong> field. If it is enter_hours, the <strong>Choose Time Slots</strong> group will be obtained and displayed the data. As we set before, this group is cloneable, so there is a loop here.</p><figure><img alt="Set the value of field in Choose Time Slots group." src="https://cdn-images-1.medium.com/max/1000/0*tMH2DAzLiiTGwesB.png" /></figure><p>After adding code, depending on if the view is new or not, choose the right <strong>Type</strong> and <strong>Location</strong> for the view in the <strong>Settings</strong> section.</p><p>Go to the single Restaurant page and see how the opening hours section displays.</p><figure><img alt="The opening hours section is displayed before styling." src="https://cdn-images-1.medium.com/max/1000/0*CbFOCsoxh8l2teDB.png" /></figure><p>All the time slots are shown exactly as I input in the backend. But this section doesn’t look as good as I want. So, I will add some CSS to style this section in the next step.</p><h3>Step 3: Style the Opening Hours Section</h3><p>Still, in the view of the single Restaurant page, go to the <strong>CSS</strong> tab.</p><figure><img alt="Go to the CSS tab to style the Opening Hours Section" src="https://cdn-images-1.medium.com/max/1000/0*theLqmFj1lnVlCVp.png" /></figure><p>And then, add the code below.</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>Now, go back to the single restaurant page, you’ll see the Opening Hours section looks much more beautiful.</p><figure><img alt="The Opening Hours section looks much more beautiful." src="https://cdn-images-1.medium.com/max/1000/0*z4hpr1PuowF1RsJM.png" /></figure><h3>Last Words</h3><p>If you’re running an online food order platform or own a business that has several branches with different time zones, this tutorial may make sense to you. Try it out and share the results in the comment section. For other page builders, we’ll have some upcoming tutorials. By the way, if you have any idea about any other tutorials, feel free to leave a comment. Thank you for reading. Good luck!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/display-restaurant-opening-hours-p1-meta-box-gutenberg/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ff7a1d4e962" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-display-opening-hours-for-restaurants-p1-using-meta-box-gutenberg-7ff7a1d4e962">How to Display Opening Hours for Restaurants — P1 — Using Meta Box + Gutenberg</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Display Product Variations — P1 — Using Meta Box and Gutenberg]]></title>
            <link>https://medium.com/meta-box/how-to-display-product-variations-p1-using-meta-box-and-gutenberg-ca3436554dbc?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/ca3436554dbc</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[gutenberg]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[variation]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 02:32:39 GMT</pubDate>
            <atom:updated>2022-01-25T02:32:37.621Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Display Product Variations — P1 — Using Meta Box and Gutenberg</h3><figure><img alt="How to Display Product Variations — P1 — Using Meta Box and Gutenberg" src="https://cdn-images-1.medium.com/max/1000/0*wUpGKDInkYiFpw96.jpg" /></figure><p>In eCommerce, we usually see a product that has a bunch of different variations. For example, a T-shirt may have different colors along with different information such as size and price, then each one will be a variation.</p><p>Today, we are going to display them all in a clever way on the single product page. <strong>Whenever you click on a color button, all the corresponding information of that variation will be displayed, even in the image gallery</strong>.</p><figure><img alt="The example of displaying product variations on the single product page" src="https://cdn-images-1.medium.com/max/1024/0*yaSPyupxfj3cqC6J.gif" /></figure><p>To do that, we need some particular techniques. In this practice, we’ll use custom fields created by Meta Box. By the way, we do not use any theme, just Gutenberg here.</p><h3>Before Getting Started</h3><p>To add all of the extra information for variations, we need custom fields. So, the first tool on the list is <a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>. This is the framework to create custom fields &amp; custom post types. It’s free and available on <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>. We also use some advanced features of Meta Box by using the following extensions:</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Type &amp; Custom Taxonomies</a>: It’s a free extension of Meta Box to create custom post types.</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: This premium extension provides a UI in the back end to create custom fields easily.</li><li><a href="https://metabox.io/plugins/meta-box-conditional-logic/">Meta Box Conditional Logic</a>: It lets you show fields precisely as any rules you want.</li><li><a href="https://metabox.io/plugins/meta-box-group/">Meta Box Group</a>: This extension helps you organize custom fields into repeatable and collapsible groups.</li><li><a href="https://metabox.io/plugins/mb-views/">MB Views</a>: It helps you to create templates without touching the theme files as well as get the custom fields’ value and display them.</li></ul><h3>Video Tutorial</h3><p><a href="https://youtu.be/CpitJzTnWWo">https://youtu.be/CpitJzTnWWo</a></p><h3>Step 1: Create a New Custom Post Type</h3><p>Go to <strong>Meta Box</strong> &gt; <strong>Post Types</strong> &gt; <strong>New Post Type</strong>. After creating a new post type, you will see a new menu appears on your dashboard. It’s your new post type.</p><figure><img alt="A new menu appears after creating a new post type." src="https://cdn-images-1.medium.com/max/1024/0*5QOgJ-OC5tm71wuF.png" /></figure><h3>Step 2: Create Custom Fields</h3><p>Go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong> &gt; <strong>Add New</strong>.</p><figure><img alt="Create custom fields by Meta Box." src="https://cdn-images-1.medium.com/max/1024/0*48K2uuioS1zILXNz.png" /></figure><p>We have a <a href="https://youtu.be/_DaFUt92kYY">tutorial on how to create custom fields</a>, you can refer to it for more information.</p><p>As you can see here, I have a <strong>Switch</strong> field to confirm whether the product has variations or not. If your product doesn’t have any variation, it is a simple product, so the <strong>Simple Product</strong> group will be displayed for inputting data.</p><p>Then, there is some basic information that we put in that group with subfields inside.</p><figure><img alt="Simple Product group with subfields inside" src="https://cdn-images-1.medium.com/max/1024/0*JSNTFVu9WyPRO7qT.png" /></figure><p>If the product has any variations, the <strong>Variations of Product</strong> group will be displayed. This group also has subfields similar to the <strong>Simple Product</strong> group. In addition, it has an extra subfield inside to define the name of the variation which is <strong>Color Name</strong>.</p><p>To set the rule about when those groups display, we need to set rules in the <strong>Conditional Logic</strong> section in their <strong>Advanced Settings</strong> tab.</p><p>Just choose the key as the ID of the Switch field, and the value as 0 or 1. These values correspond to No and Yes options of this field.</p><figure><img alt="Set the conditional rule for Simple Product." src="https://cdn-images-1.medium.com/max/1024/0*tYF2IC3RzQ9LqRmQ.png" /><figcaption>Set the conditional rule for Simple Product</figcaption></figure><p>0 is set for the <strong>Simple Product</strong> group field. So, when the Switch field is set to be No, this group will be displayed.</p><figure><img alt="Set the conditional rule for Variations of Product." src="https://cdn-images-1.medium.com/max/1024/0*1KwPZsMSuKRRCQK3.png" /><figcaption>Set the conditional rule for Variations of Product</figcaption></figure><p>Do likewise, 1 is set to the <strong>Variations of Product</strong> group field.</p><p>One more thing, there is usually more than one variation. Thus, we set the <strong>Variations of Product</strong> group as cloneable to have more spaces to add variations.</p><figure><img alt="Set the Variations of Product group as cloneable to have more spaces to add variations." src="https://cdn-images-1.medium.com/max/1024/0*BBj8JWERpFBjqdyy.png" /></figure><p>After having all the custom fields, go to the <strong>Settings</strong> tab of the field group, and choose the <strong>Location</strong> as the post type of the products that we’ve just created to apply the custom fields to it.</p><figure><img alt="Choose the Location as Post Type of the product." src="https://cdn-images-1.medium.com/max/1024/0*QUYfiecOQrAVldai.png" /></figure><p>Back to the post editor, you will see all of the created custom fields.</p><figure><img alt="The created custom fields are displayed in post editor." src="https://cdn-images-1.medium.com/max/1024/0*NKCH6xlTQ1qyZ7WP.gif" /></figure><p>Now, just enter the information into the fields.</p><h3>Step 3: Display the Product Variations Information on the Product Page</h3><p>To display the product variations information on the product page, you normally have to go to the theme’s files to add code or use a page builder. But, in Gutenberg, you have another way with Meta Box. It has the <strong>MB Views</strong> extension to create templates without touching the theme’s files.</p><p>So, let’s create a new template using it.</p><p>Instead of typing code into the box in the <strong>Template</strong> tab, you can insert fields to get their data.</p><figure><img alt="Insert fields to get data in the Template tab.." src="https://cdn-images-1.medium.com/max/1024/0*DPvTG34tVF7c5FMh.png" /></figure><p>Just click the <strong>Insert Field</strong> button and choose which one you want.</p><figure><img alt="The example of inserting a field in the Template tab." src="https://cdn-images-1.medium.com/max/1024/0*az4fmNwBd7WFG3Rc.png" /></figure><p>It is necessary to edit the code a little bit when we insert fields. Here is mine after the modification.</p><pre>{% set product_types = post.does_this_product_have_variations %}<br>{% if (product_types == 0) %}<br>    {% for item in post.simple_product.product_images %}<br>        &lt;img src=&quot;{{ item.large.url }}&quot; width=&quot;{{ item.large.width }}&quot; height=&quot;{{ item.large.height }}&quot; alt=&quot;{{ item.large.alt }}&quot;&gt;<br>    {% endfor %}<br>    {% for item in post.simple_product.product_images %}<br>        &lt;img src=&quot;{{ item.thumbnail.url }}&quot; width=&quot;{{ item.thumbnail.width }}&quot; height=&quot;{{ item.thumbnail.height }}&quot; alt=&quot;{{ item.thumbnail.alt }}&quot;&gt;<br>    {% endfor %}<br>    {{ post.title }}<br>    {{ post.content }}<br>    {% if post.simple_product.promotional_price|trim is empty %}<br>        {{ post.simple_product.original_price }}<br>    {% else %}<br>        {{ post.simple_product.promotional_price }}<br>        {{ post.simple_product.original_price }}<br>    {% endif %}<br>    {% for item in post.simple_product.size %}<br>        {{ item.label }}<br>    {% endfor %}<br>    {{ post.simple_product.status.label }}<br>{% else %}<br>    {% for clone in post.variations_of_product %}<br>        {% for item in clone.product_images %}<br>            &lt;img src=&quot;{{ item.large.url }}&quot; width=&quot;{{ item.large.width }}&quot; height=&quot;{{ item.large.height }}&quot; alt=&quot;{{ item.large.alt }}&quot;&gt;<br>        {% endfor %}<br>        {% for item in clone.product_images %}<br>            &lt;img src=&quot;{{ item.thumbnail.url }}&quot; width=&quot;{{ item.thumbnail.width }}&quot; height=&quot;{{ item.thumbnail.height }}&quot; alt=&quot;{{ item.thumbnail.alt }}&quot;&gt;<br>        {% endfor %}<br>    {% endfor %}<br>    {{ post.title }}<br>    {{ post.content }}<br>    {% for clone in post.variations_of_product %}<br>        {{ clone.color_name.label }}<br>    {% endfor %}<br>    {% for clone in post.variations_of_product %}<br>        {% if clone.promotional_price|trim is empty %}<br>            {{ clone.original_price }}<br>        {% else %}<br>            {{ clone.promotional_price }}<br>            {{ clone.original_price }}<br>        {% endif %}<br>    {% endfor %}<br>    {% for clone in post.variations_of_product %}<br>        {% for item in clone.size %}<br>            {{ item.label }}<br>        {% endfor %}<br>    {% endfor %}<br>    {% for clone in post.variations_of_product %}<br>        {{ post.simple_product.status.label }}<br>    {% endfor %}<br>{% endif %}</pre><p>In there, product_types is the variable to admit the value of the <strong>Switch</strong> field. If it is 0, it means that the product has no variation. So, the next lines of code will get the value of the fields inside the <strong>Simple Product</strong> group. Otherwise, when the returned value is 1, the value of fields inside the <strong>Variations of Product</strong> group will be displayed.</p><figure><img alt="The product_types variable admits the value of the Switch field." src="https://cdn-images-1.medium.com/max/1024/0*o51-2tKDyFficQEu.png" /></figure><p>Also in the code, I get the value from each <strong>Product Image</strong> field twice. One displays in the large size, and one in the thumbnail size. All of them will be used to set a slider.</p><figure><img alt="Get the value from each Product Image field twice to display both large size and thumbnail size." src="https://cdn-images-1.medium.com/max/1024/0*Pmd99DfMaBGHF3CQ.png" /></figure><p>These lines of code are to know when the product or variation has any promotion price and set a rule to display both of the original and promotional prices or just the original one.</p><figure><img alt="Get the value of price field and set a rule to display it." src="https://cdn-images-1.medium.com/max/1024/0*eQUrR9ndlMb5SZly.png" /></figure><p>Next, move to the <strong>Settings</strong> section of the view. Assign this template to the single product page. And now, go to any single product page, see the result.</p><figure><img alt="The result of displaying product variations after inserting wanted fields.." src="https://cdn-images-1.medium.com/max/1024/0*Bs2pydqJmsFaY3l3.gif" /></figure><p>It is so messy now. So, we’ll need some JS and CSS to make it more beautiful with a better layout.</p><p>Before styling, we need to edit this template a little bit more. Back to the view, then add some <strong>div</strong> tags to divide elements into sections. I put the code on our <a href="https://github.com/wpmetabox/tutorials/blob/master/display-product-variations/template.php">Github</a>, you can refer to it for more clarity.</p><p>There is a notice that I added an A tag in the place where I output the color of variations. I also created a dynamic class there. It will generate different classes using the color name.</p><figure><img alt="Add an A tag in the place where I output the color of variations." src="https://cdn-images-1.medium.com/max/1024/0*IRLebpUAtivlcpU3.png" /></figure><p>I also added an attribute named <strong>data-id</strong> for price, size, status as well as the image gallery. This attribute will admit the value of the corresponding color name.</p><figure><img alt="Add an attribute named data-id to admit the value of the corresponding color name for price, size, status, image gallery." src="https://cdn-images-1.medium.com/max/1024/0*IbmhKlSpc0JTQ8KL.png" /></figure><p>Back to the single product page, all the elements have been just reordered.</p><figure><img alt="The elements of product variation have been reordered after adding div tags." src="https://cdn-images-1.medium.com/max/1024/0*qyJUabfn1hYNq1fK.gif" /></figure><p>Let’s move to the next step.</p><h3>Step 4: Set Rules to Display the Variations’ Information</h3><p>As you see at the beginning of this video, the images of the product variations are in a slider and the information of each variation displays only when you choose the matching color. To have it, I use some JS and CSS. However, I’m using <strong>My Custom Functionality</strong> plugin instead of adding them directly to the theme. So, when I change the theme, it won’t be affected. You can download this plugin from <a href="https://github.com/wpmetabox/tutorials/tree/master/display-product-variations/my-custom-functionality-master">GitHub</a> and install it on your website.</p><h3>Download the JS and CSS Library</h3><p>For the JS and CSS, I use the Slick library. It’s also available on <a href="https://github.com/kenwheeler/slick/tree/master/slick">Github</a>. It includes several files as you can see here. But, we just need three of them.</p><figure><img alt="JS and CSS files in the Slick library." src="https://cdn-images-1.medium.com/max/1024/0*KPl9siswh5_DnsmU.png" /></figure><p>Go to the folder of the My Custom Functionality plugin. Upload them into the corresponding JS and CSS folders.</p><figure><img alt="Upload the slick-theme.css file into the css folder of My Custom Functionality plugin." src="https://cdn-images-1.medium.com/max/1024/0*6AnHwkDusE0AmzIB.png" /></figure><h3>Create Custom JS for Slider and Rules</h3><p>Next, to set a rule that stipulates for displaying the information of each variation as well as the slider, I’ll create a custom.js file in the js folder and add the following code to it.</p><figure><img alt="Add code to custom.js file." src="https://cdn-images-1.medium.com/max/1024/0*aVxCHptZv2-PHtTU.png" /></figure><pre>jQuery(document).ready(function ($) {<br>    $(&#39;.slider-single&#39;).slick({<br>        slidesToShow: 1,<br>        slidesToScroll: 1,<br>        arrows: false,<br>        adaptiveHeight: false,<br>        infinite: false,<br>        useTransform: true,<br>        speed: 400,<br>        cssEase: &#39;cubic-bezier(0.77, 0, 0.18, 1)&#39;,</pre><pre>    });</pre><pre>    $(&#39;.slider-nav&#39;)<br>        .on(&#39;init&#39;, function (event, slick) {<br>            $(&#39;.slider-nav .slick-slide.slick-current&#39;).addClass(&#39;is-active&#39;);<br>        })<br>        .slick({<br>            slidesToShow: 4,<br>            slidesToScroll: 4,<br>            dots: false,<br>            focusOnSelect: false,<br>            infinite: false,<br>            responsive: [{<br>                breakpoint: 1024,<br>                settings: {<br>                    slidesToShow: 5,<br>                    slidesToScroll: 5,<br>                }<br>            }, {<br>                breakpoint: 640,<br>                settings: {<br>                    slidesToShow: 4,<br>                    slidesToScroll: 4,<br>                }<br>            }, {<br>                breakpoint: 420,<br>                settings: {<br>                    slidesToShow: 3,<br>                    slidesToScroll: 3,<br>                }<br>            }]<br>        });</pre><pre>    $(&#39;.slider-single&#39;).on(&#39;afterChange&#39;, function (event, slick, currentSlide) {<br>        $(&#39;.slider-nav&#39;).slick(&#39;slickGoTo&#39;, currentSlide);<br>        var currrentNavSlideElem = &#39;.slider-nav .slick-slide[data-slick-index=&quot;&#39; + currentSlide + &#39;&quot;]&#39;;<br>        $(&#39;.slider-nav .slick-slide.is-active&#39;).removeClass(&#39;is-active&#39;);<br>        $(currrentNavSlideElem).addClass(&#39;is-active&#39;);<br>    });</pre><pre>    $(&#39;.slider-nav&#39;).on(&#39;click&#39;, &#39;.slick-slide&#39;, function (event) {<br>        event.preventDefault();<br>        var goToSingleSlide = $(this).data(&#39;slick-index&#39;);</pre><pre>        $(&#39;.slider-single&#39;).slick(&#39;slickGoTo&#39;, goToSingleSlide);<br>    });<br>    jQuery(&quot;.grouped-product .color-contain-group .color-group .color-name a&quot;).click(function (e) {<br>        jQuery(&quot;.color-contain-group .color-group .color-name&quot;).removeClass(&quot;active&quot;);<br>        jQuery(this).show();<br>        jQuery(this).parent().addClass(&quot;active&quot;);<br>        jQuery(&quot;div[data-id]&quot;).removeClass(&quot;active&quot;);<br>        jQuery(&quot;div[data-id=&#39;&quot; + jQuery(this).attr(&quot;href&quot;).replace(&quot;#&quot;, &quot;&quot;) + &quot;&#39;]&quot;).addClass(&quot;active&quot;);<br>        jQuery(&#39;.slider-single&#39;).slick(&#39;refresh&#39;);<br>        jQuery(&#39;.slider-nav&#39;).slick(&#39;refresh&#39;);<br>        e.preventDefault();<br>    });</pre><pre>    jQuery(&quot;.size-contain-group .size-group .info .list-size a&quot;).click(function (e) {<br>        e.preventDefault();<br>    });</pre><pre>    jQuery(&#39;.size-contain-group .size-group .info .list-size .size-name&#39;).click(function(){<br>        jQuery(this).addClass(&#39;active&#39;);<br>        jQuery(&#39;.size-contain-group .size-group .info .list-size .size-name&#39;).not(this).removeClass(&#39;active&#39;)<br>    })<br>})</pre><p><strong>Explanation</strong>:</p><ul><li>$(&#39;.slider-single&#39;).slick({ }): to create a slider for the elements that have the .slider-single class. They are product images that I set to display in a large size.</li><li>$(&#39;.slider-nav&#39;): to create a slider as well. The elements which have the .slider-nav class are product images which I set to display in the thumbnail size.</li><li>.on(&#39;init&#39;, function (event, slick) { }): to identify which thumbnail is in the current slide. And, that thumbnail will be added a class as “is active”.</li><li>$(&#39;.slider-single&#39;).on(&#39;afterChange&#39;, function (event, slick, currentSlide) { }): to trigger the event that someone clicks on the large image to move to the other one, then the thumbnail slider will be changed to the corresponding thumbnail.</li><li>$(&#39;.slider-nav&#39;).on(&#39;click&#39;, &#39;.slick-slide&#39;, function (event) { }): to trigger that event when someone clicks on the thumbnail slider. Then, it also displays the corresponding large image in the large slider.</li><li>jQuery(&quot;.grouped-product .color-contain-group .color-group .color-name a&quot;).click(function (e) { }): to trigger when someone clicks on a product color using the A tag we added in the view.</li><li>jQuery(&quot;.color-contain-group .color-group .color-name&quot;).removeClass(&quot;active&quot;); jQuery(this).show(); jQuery(this).parent().addClass(&quot;active&quot;): to remove the active class from the unselected color and add it to the selected one.</li><li>jQuery(&quot;div[data-id]&quot;).removeClass(&quot;active&quot;); jQuery(&quot;div[data-id=&#39;&quot; + jQuery(this).attr(&quot;href&quot;).replace(&quot;#&quot;, &quot;&quot;) + &quot;&#39;]&quot;).addClass(&quot;active&quot;): to remove and add the active class to all the elements that have the value of the data-id attribute as the name of the color. It means that when you click on a color, all the corresponding information of that variation such as price, size, status, and image gallery will be displayed.</li><li>jQuery(&#39;.slider-single&#39;).slick(&#39;refresh&#39;) and jQuery(&#39;.slider-nav&#39;).slick(&#39;refresh&#39;): to refresh both sliders to load new images.</li></ul><h3>Declare the JS and CSS Files</h3><p>Now, add code inside the function custom_enqueue_files() in the plugin.php file.</p><pre>wp_enqueue_style(&#39;slick&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick.css&#39;);<br>wp_enqueue_style(&#39;slick-theme&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick-theme.css&#39;);</pre><pre>wp_enqueue_script(&#39;custom&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/custom.js&#39;, [&#39;jquery&#39;]);<br>wp_enqueue_script(&#39;slick-min&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/slick.min.js&#39;, [&#39;jquery&#39;]);<br>wp_enqueue_script(&#39;script&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/script.js&#39;, [&#39;jquery&#39;]);</pre><p>Now, the product images have already turned into a slider but we cannot see all the information of each variation in the right place.</p><figure><img alt="The product images have already turned into a slider." src="https://cdn-images-1.medium.com/max/1024/0*8gf_2u7xSS7zeL7b.gif" /></figure><h3>Step 5: Style the Product Page</h3><p>Traditionally, you have to add CSS to the Customizer or the theme’s file. But, with MB Views, you have a CSS tab for it.</p><figure><img alt="Add code to CSS tab." src="https://cdn-images-1.medium.com/max/1024/0*K_j7RtL-jCkvw8w9.png" /></figure><p>There are many classes I used in this code. You can refer to all of it on <a href="https://github.com/wpmetabox/tutorials/tree/master/display-product-variations">Github</a>.</p><p>Now, back to a single product page, it turned into a new look. When you choose a color, the photo gallery will automatically change according to that color. At the same time, the sizes and prices also change correspondingly.</p><figure><img alt="The product variations turned into a new look." src="https://cdn-images-1.medium.com/max/1024/0*q1ecV0P85l8cFj2k.gif" /></figure><h3>Last Words</h3><p>As you see, displaying the product variations on the single product page with Meta Box and custom field is not something difficult. If you use another page builder, keep track of our blogs for more upcoming tutorials. If you are confused or have any ideas, let us know by leaving a comment. See you next blog!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/display-product-variations-p1-meta-box-gutenberg/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca3436554dbc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-display-product-variations-p1-using-meta-box-and-gutenberg-ca3436554dbc">How to Display Product Variations — P1 — Using Meta Box and Gutenberg</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Display The Latest Products Section — P3 — Using Meta Box And Oxygen]]></title>
            <link>https://medium.com/meta-box/display-the-latest-products-section-p3-using-meta-box-and-oxygen-f3caad34dc1e?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/f3caad34dc1e</guid>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[latest]]></category>
            <category><![CDATA[oxygen]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 18 Jan 2022 02:33:07 GMT</pubDate>
            <atom:updated>2022-01-18T02:33:04.341Z</atom:updated>
            <content:encoded><![CDATA[<h3>Display The Latest Products Section — P3 — Using Meta Box And Oxygen</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*BOT9Kr5Vy7tDJm-i.jpg" /></figure><p>In this next part of this series, we’re going to figure out <strong>how to have a section for the latest products using Meta Box and another website builder, Oxygen</strong>. This section will be the same as the last ones we created in the previous posts.</p><figure><img alt="The example of creating the latest products section" src="https://cdn-images-1.medium.com/max/1024/0*q7KiPryPN6yOVqkT.gif" /></figure><p>Are you ready to start?</p><h3>Before Getting Started</h3><p>We’ll display some extra information about the products in the latest product section. Most of them will be in custom fields, so we need <a href="https://metabox.io/">Meta Box plugin</a> to have a framework to create custom fields. It’s free on <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>.</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Type &amp; Custom Taxonomies</a>: this is a free Meta Box extension that helps create custom post types. You can also download it from <a href="https://vi.wordpress.org/plugins/mb-custom-post-type/">wordpress.org</a>;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: this Meta Box premium extension provides you with an UI to create and configure custom fields in the back end. If you don’t want to use this premium extension, you can code manually or use this free <a href="https://metabox.io/online-generator/">Online Generator</a> tool to generate code.</li></ul><p>Finally, <a href="https://oxygenbuilder.com/">Oxygen Builder</a>, and remember to use the 3.9 version or upper to have the native integration with Meta Box.</p><h3>Video Version</h3><p><a href="https://youtu.be/2TndR67aQQk">https://youtu.be/2TndR67aQQk</a></p><h3>Step 1: Create a New Custom Post Type</h3><p>In the <strong>Admin Dashboard</strong>, go to <strong>Meta Box</strong> &gt; <strong>Post Types</strong> &gt; <strong>New Post Type</strong> to create a new post type for products.</p><p>After publishing, you will see a new menu in your dashboard.</p><figure><img alt="A new menu appears after creating a new post type for the products." src="https://cdn-images-1.medium.com/max/1000/0*znmKYqGK9mJRdLJZ.png" /></figure><h3>Step 2: Create Custom Fields for the Post Type</h3><p>In the Admin Dashboard, go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong> &gt; <strong>Add New</strong>. You will see an UI to create custom fields if you have Meta Box Builder already.</p><p>Meta Box has more than 50 field types, so you can choose any type of field to input any data you want. We already have a <a href="https://www.youtube.com/watch?v=WWeaM5vIAwM">video about all Meta Box field types</a> and each field’s features so you can learn about each one.</p><p>Just choose one from the drop-down list to have your wanted field as in the below picture.</p><figure><img alt="Create custom fields for the products." src="https://cdn-images-1.medium.com/max/1000/0*ByT9RQsqHDknkWSi.png" /></figure><p>When configuring the fields, you should choose the easy-to-remember labels and IDs because you will need to use them in the next step.</p><p>As for the <strong>Restaurant Status</strong> and <strong>Voucher</strong> field, they’re selection fields so we’ll have the <strong>Choice</strong> box to add options like this.</p><figure><img alt="Add options for the Restaurant Status field" src="https://cdn-images-1.medium.com/max/1000/0*BxCeAc28L61a4wk0.png" /><figcaption>Add options for the Restaurant Status field</figcaption></figure><figure><img alt="Add options for the Voucher field" src="https://cdn-images-1.medium.com/max/1000/0*0LM5R_yBcBP-P9Bh.png" /><figcaption>Add options for the Voucher field</figcaption></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab. Remember to choose the <strong>Location</strong> as <strong>Post Type</strong> and select your product’s post type to apply these fields to it.</p><figure><img alt="Choose the Location as Post Type of the product." src="https://cdn-images-1.medium.com/max/1000/0*rnH7i3mO-edxi9r8.png" /></figure><p>Now, when creating a new post in my <strong>Restaurant</strong> post type, the custom fields will be here.</p><figure><img alt="The custom fields are already in the post." src="https://cdn-images-1.medium.com/max/1000/0*psfO0XGsvyAQsyn_.png" /></figure><p>Let’s move to the next step to display the Latest Products section on the frontend.</p><h3>Step 3: Add a Section for the Latest Products on Homepage</h3><p>You can create a new page or choose an existing page you want to add the section, and then edit it with Oxygen. I’m going to put it on my homepage.</p><figure><img alt="Choose the wanted page to add the latest product section, and edit it with Oxygen." src="https://cdn-images-1.medium.com/max/1000/0*skOhXV06-3KpgtU4.png" /></figure><p>The latest products section is a list of posts, so we’ll choose the <strong>Repeater</strong> component first.</p><p>In this component settings, choose <strong>Query</strong> &gt; <strong>Custom</strong> &gt; <strong>Post Type</strong>, then search for the post type you want to get posts.</p><figure><img alt="Choose Query &gt; Custom &gt; Post Type, then search for the post type you want to get posts." src="https://cdn-images-1.medium.com/max/1024/0*wB2RXVaa_lHFNoow.gif" /></figure><p>Because we haven’t chosen any kind of information about the product to show yet, it’s still blank here.</p><figure><img alt="Repeater is still blank when we haven’t chosen any kind of product information yet." src="https://cdn-images-1.medium.com/max/1000/0*q76dQ51gctVv84rY.png" /></figure><p>Now, add some components to display them such as name, featured image, status, and so on.</p><p>First, to display featured images of the post. Add a <strong>Featured Image</strong> component.</p><figure><img alt="Add a Featured Image component to display featured image for the post." src="https://cdn-images-1.medium.com/max/1024/0*2SZXcfZv0ckyNugP.gif" /></figure><p>Then, you will see all the featured images of the posts.</p><figure><img alt="The featured images of the posts are displayed." src="https://cdn-images-1.medium.com/max/1024/0*411ioUhBtovR5IZc.gif" /></figure><p>To display the name of the restaurant means the post title, choose the <strong>Text</strong> component. Then, we need to connect this component to the post title to get dynamic data. Click the <strong>Insert Data</strong> button and go to the <strong>Post</strong> section, choose <strong>Title</strong>.</p><figure><img alt="Choose Text component to display the restaurant’s name and connect it to the post title to get dynamic data." src="https://cdn-images-1.medium.com/max/1024/0*iDKunPJV5_Oxvups.gif" /></figure><p>Now, all the names of restaurants are shown here.</p><figure><img alt="All the restaurant’s name are shown" src="https://cdn-images-1.medium.com/max/1000/0*3GIm9rm4X45a9Io4.png" /></figure><p>For the address, choose the <strong>Text</strong> component as well. However, you need to connect it to a <strong>Meta Box field</strong> to get data. Following the actions as I did in the below gif.</p><figure><img alt="Settings for Address field." src="https://cdn-images-1.medium.com/max/1024/0*9u9iR3P7TudcwEr6.gif" /></figure><p>Then, the addresses corresponding to each restaurant will be shown.</p><figure><img alt="The addresses corresponding to each restaurant will be shown" src="https://cdn-images-1.medium.com/max/1000/0*Qf2NHVs-KL5i3x1-.png" /></figure><p>For other information such as restaurant status and voucher, do likewise.</p><p>The <strong>Restaurant Status</strong> is a select field and it has options as I set when creating it as I show in this pic. Each option always has 2 elements that are value and label.</p><figure><img alt="The options of Restaurant Status field" src="https://cdn-images-1.medium.com/max/1000/0*qf460HCjJ2O9WXld.png" /></figure><p>So, when inserting data from this kind of field, you’ll see a setting:<strong> Return value or label?</strong> to choose the kind of output data.</p><figure><img alt="Choose the kind of output data in a setting — Return value or label?" src="https://cdn-images-1.medium.com/max/1000/0*tO3o3rdgkRsmeY0b.png" /></figure><p>For the logo, it’s a single image field, so I choose the <strong>Code Block</strong> component and set it as <strong>PHP &amp; HTML</strong>.</p><figure><img alt="Choose the Code Block component to display the logo" src="https://cdn-images-1.medium.com/max/1000/0*9eRLYfVGgw7AVD92.png" /></figure><p>Add this below code to the box.</p><pre>&lt;?php<br>    $image = rwmb_meta( &#39;logo&#39;, array( &#39;size&#39; =&gt; &#39;origin&#39; ) );<br>    echo &#39;&lt;img src=&quot;&#39;, $image[&#39;url&#39;], &#39;&quot;&gt;&#39;;</pre><pre>?&gt;</pre><figure><img alt="Add code to Code Block to display the logo" src="https://cdn-images-1.medium.com/max/1000/0*WVm_B6MVA2TrBiUQ.png" /></figure><p><strong>In this code</strong>:</p><ul><li>$image = rwmb_meta( &#39;logo&#39;, array( &#39;size&#39; =&gt; &#39;origin&#39; ) ); is used to get the data from the Logo field;</li><li>echo &#39;&lt;img src=&quot;&#39;, $image[&#39;url&#39;], &#39;&quot;&gt;&#39;; is used to display the image.</li></ul><p>Save the changes for this page and go to it in the front end to see how the latest products section is displayed.</p><figure><img alt="The latest products section is displayed after editing with Oxygen." src="https://cdn-images-1.medium.com/max/1024/0*iR3aiVFIQiwxPOkq.gif" /></figure><p>It doesn’t look as good as I want. So I will style it in the next steps.</p><h3>Step 4: Restructure Components and Set CSS Classes for Elements</h3><h3>Restructure Components</h3><p>Before styling my latest products section, I will add several additional components, including <strong>Div</strong> tag to rearrange all the components into a better structure.</p><figure><img alt="Add additional components to have a better structure before styling." src="https://cdn-images-1.medium.com/max/1024/0*WaJrx-fJo15lP8Ey.gif" /></figure><figure><img alt="Add Div tag to rearrange all the components into a better structure" src="https://cdn-images-1.medium.com/max/1000/0*-wiJYQ2MCJZNATc4.png" /></figure><p>As you see the latest products section at the beginning of this post, when users hover over a featured image of a restaurant, a <strong>View Detail</strong> button will appear. So I’ll add a <strong>Text Link</strong> component and rename it.</p><figure><img alt="Setting for View Detail." src="https://cdn-images-1.medium.com/max/1000/0*CCQXmZj2jic2JQ4f.png" /></figure><p>I also want to link the <strong>View Detail</strong> button to the post URL so that people can click it to see the post, so I inserted data from <strong>Permalink</strong> to it.</p><figure><img alt="Insert data from Permalink to link the View Detail button to the post URL ." src="https://cdn-images-1.medium.com/max/1000/0*dAVFzMy9Srz4Lm-m.gif" /></figure><h3>Add Classes for Elements</h3><p>I add some classes for elements. They will be used in the next steps for styling.</p><h3>Step 5: Create Slider for the Latest Products Section</h3><p>To display the latest products section as a slider, we have to add CSS and JS. However, instead of adding directly to the theme file, I installed an additional plugin called <strong>My Custom Functionality</strong>. So when I change the theme, it won’t be affected. You can download this plugin <a href="https://github.com/srikat/my-custom-functionality">here</a> and install it on your WordPress website as well.</p><h3>Download JS and CSS library</h3><p>I will use the Slick Slider library for my JS and CSS. Download it here.</p><p>You will see many files there, but we just need to use these 3 files: slick.css, slick-theme.css, and slick-min.js.</p><p>Go to the folder of <strong>My Custom Functionality </strong>plugin and upload them into the corresponding js and css folders.</p><h3>Set Up the Slider Effect</h3><p>To set up the slider effect of Slick Slider, I’ll create a new custom.js file in the js folder and add this code.</p><figure><img alt="Add code to the custom.js file." src="https://cdn-images-1.medium.com/max/1000/0*lDhMg5RGpgxLlcg5.png" /></figure><pre>jQuery(document).ready(function ($) {<br>    jQuery(&quot;.list-restaurant .slider-res&quot;).slick({<br>        infinite: false,<br>        dots: false,<br>        autoplay: false,<br>        speed: 800,<br>        autoplaySpeed: 4000,<br>        slidesToShow: 3,<br>        slidesToScroll: 3,<br>        nextArrow: &#39;&lt;button class=&quot;next-btn&quot;&gt;Next&lt;/button&gt;&#39;,<br>        prevArrow: &#39;&lt;button class=&quot;prev-btn&quot;&gt;Previous&lt;/button&gt;&#39;<br>    });<br>    jQuery(&#39;.status-res span&#39;).each(function () {<br>        if (jQuery(this).html() == &#39;Open&#39;) {<br>            jQuery(this).parent().addClass(&#39;open&#39;);<br>        } else {<br>            jQuery(this).parent().addClass(&#39;close&#39;);<br>        }<br>    });<br>})</pre><p><strong>In the code</strong>:</p><ul><li>jQuery(&quot;.list-restaurant .slider-res&quot;).slick({: to create a slider for the elements in the slider-res class. And the slider will have the style of the Slick Slider library;</li><li>jQuery(&#39;.status-res span&#39;).each(function () {: to create a dynamic class based on the returned values of the status in the section that I put in the status-res class. If the returned value is open, the class will be open. If the returned value is close, the class will be close. Depending on the created class, I will have two different styles for the two statuses of the restaurant.</li></ul><h3>Declare the JS and CSS files</h3><p>We need to declare the JS and CSS files that we have just uploaded. Do it by adding this code to the custom_enqueue_files() function in the plugin.php file of the My Custom Functionality plugin.</p><pre>wp_enqueue_style(&#39;slick&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick.css&#39;);<br>wp_enqueue_style(&#39;slick-theme&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick-theme.css&#39;);<br>wp_enqueue_script(&#39;custom&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/custom.js&#39;, [&#39;jquery&#39;]);<br>wp_enqueue_script(&#39;slick-min&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/slick.min.js&#39;, [&#39;jquery&#39;]);</pre><figure><img alt="Add code to the plugin.php file" src="https://cdn-images-1.medium.com/max/1000/0*pHZSPCkYUs5tQpUi.png" /></figure><p>Now, go to the homepage, the latest products section has already turned into a slider like this.</p><figure><img alt="The latest products section has already turned into a slider" src="https://cdn-images-1.medium.com/max/1024/0*xqo-7FuQl_BY-fqL.gif" /></figure><p>But it hasn’t looked good yet. So, it’s time to add some additional CSS.</p><h3>Step 6: Add CSS to Style the Latest Products Section</h3><p>In the Oxygen preview, choose <strong>Manage</strong> &gt; <strong>Stylesheet</strong> and <strong>Add Stylesheet</strong>. Then, add some CSS.</p><figure><img alt="Choose Manage &gt; Stylesheet and Add Stylesheet and add some CSS." src="https://cdn-images-1.medium.com/max/1024/0*6Jh81CUdOa3W9dya.gif" /></figure><p>This is the CSS that I used:</p><p><a href="https://github.com/wpmetabox/tutorials/blob/master/display-latest-posts-with-Oxygen/custom.css">https://github.com/wpmetabox/tutorials/blob/master/display-latest-posts-with-Oxygen/custom.css</a></p><p>Let’s see how the latest products section displays on the Homepage. It’s much more beautiful, isn’t it?</p><figure><img alt="The latest products section turned to the beautiful look" src="https://cdn-images-1.medium.com/max/1024/0*XMSfrphEu5opcFbp.gif" /></figure><p>To refer to all the code and the library that I used, you can visit here:</p><p><a href="https://github.com/wpmetabox/tutorials/tree/master/display-latest-posts-with-Oxygen">https://github.com/wpmetabox/tutorials/tree/master/display-latest-posts-with-Oxygen</a></p><h3>Last Words</h3><p>We’ve gone through all the steps to <strong>display the latest products section using Meta Box plugin and Oxygen Builder</strong>. Try it out and share the results in the comment section. In the event that you have projects using another page builder, refer to the other posts in this series. Or if you want to suggest any tutorials, feel free to leave a comment. Thank you for reading. Good luck!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/display-latest-products-section-p3-meta-box-oxygen/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3caad34dc1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/display-the-latest-products-section-p3-using-meta-box-and-oxygen-f3caad34dc1e">Display The Latest Products Section — P3 — Using Meta Box And Oxygen</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Display The Latest Products Section — P2 — Using Meta Box and Elementor]]></title>
            <link>https://medium.com/meta-box/display-the-latest-products-section-p2-using-meta-box-and-elementor-3793573ca1?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/3793573ca1</guid>
            <category><![CDATA[latest]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[elementor]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[meta-box]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 11 Jan 2022 03:37:23 GMT</pubDate>
            <atom:updated>2022-01-11T03:37:23.632Z</atom:updated>
            <content:encoded><![CDATA[<h3>Display The Latest Products Section — P2 — Using Meta Box and Elementor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*mmh74Y2zpPA7eVYR.jpg" /></figure><p>In the previous part of the series “<strong>How to display the Latest Products section in different ways</strong>”, we learned how to do it with Meta Box and Gutenberg. As promised, we’re showing you another method that uses Meta Box and a page builder. Today, I choose <strong>Elementor</strong>.</p><p>I’m also going to create this section with the posts in time order: the latest products first, then the older ones. It will look like this:</p><figure><img alt="The example of creating the latest products section" src="https://cdn-images-1.medium.com/max/1024/0*VQcJiYE2T9uEkBAD.gif" /></figure><p>Now, let’s start!</p><h3>Before Getting Started</h3><p>To do it, we need <a href="https://elementor.com/">Elementor</a> first. Here I use Elementor Pro which has integration with <a href="https://metabox.io/">Meta Box</a>. You also need other tools as follows:</p><ul><li><a href="https://wordpress.org/plugins/ele-custom-skin/">Elementor Custom Skin</a>: It provides the Loop template to display the listing of posts.</li><li><a href="https://wordpress.org/plugins/meta-box/">Meta Box core plugin</a>: This is the framework to create custom fields and custom post types. It’s free on<a href="https://wordpress.org/"> wordpress.org</a>, so you can download it directly.</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Type &amp; Custom Taxonomies</a>: This is a useful extension of Meta Box. It helps you to create new custom post types. You also can download it free on <a href="https://wordpress.org/plugins/mb-custom-post-type/">wordpress.org</a>.</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: This premium extension of Meta Box provides a UI in the back end to create and configure custom fields without using code.</li><li><a href="https://metabox.io/plugins/mb-elementor-integrator/">Meta Box — Elementor integrator</a>. This extension allows you to get data from custom fields created by the Meta Box plugin in the templates of Elementor.</li></ul><p>FYI, here I use Ocean WP theme which is compatible with Elementor. Otherwise, you can choose any other ones which are compatible with Elementor as well.</p><h3>Video Version</h3><p><a href="https://youtu.be/KvYfEO-X4OA">https://youtu.be/KvYfEO-X4OA</a></p><h3>Step 1: Create a New Custom Post Type</h3><p>Go to <strong>Meta Box</strong> &gt; <strong>Post Types</strong> &gt; <strong>New Post Type</strong>.</p><figure><img alt="Create a new post type for the latest products." src="https://cdn-images-1.medium.com/max/1000/0*wV9YElwEc71zT7TT.png" /></figure><p>After publishing it, a new menu appears.</p><figure><img alt="A new menu named Restaurant appears." src="https://cdn-images-1.medium.com/max/1000/0*lwqQ8q42LECq-Dil.png" /></figure><h3>Step 2: Create Custom Fields for The Custom Post Type</h3><p>Go to <strong>Meta Box</strong> &gt; <strong>Custom Fields</strong> &gt; <strong>Add New</strong>. Meta Box Builder provides a UI in the back end to create custom fields without using code. But you also can code by yourself or use code generated by <a href="https://metabox.io/online-generator/">Online Generator</a>.</p><figure><img alt="Create custom fields for the lastest products." src="https://cdn-images-1.medium.com/max/1000/0*C8kgqMVHyzsKdIoQ.png" /></figure><p>I just need to fill in the Label and ID for fields. It is quite easy, but you should choose a simple ID to remember easily. Because you will need them in the next steps.</p><p>Meta Box supports over 50 field types, so you can choose any type of them for your own case.</p><p>For the <strong>Status</strong> and <strong>Voucher</strong> fields, I added the options in the <strong>Choices</strong> section like this:</p><figure><img alt="Add options to the Status field" src="https://cdn-images-1.medium.com/max/1000/0*hjsKlFjvnE02EdG7.png" /><figcaption>Add options to the Status field</figcaption></figure><figure><img alt="Add options to the Voucher field" src="https://cdn-images-1.medium.com/max/1000/0*E7SRH0tnCRUHzAi4.png" /><figcaption>Add options to the Voucher field</figcaption></figure><p>After creating all the fields, move to the <strong>Settings</strong> tab. In the <strong>Location</strong> section, choose the <strong>Post Types</strong> as <strong>Restaurant</strong> to apply these fields to it.</p><figure><img alt="Choose the post type as Restaurant in Location section." src="https://cdn-images-1.medium.com/max/1000/0*d_0Hq16yEzyfJ1Rm.png" /></figure><p>Now, go to the post editor in <strong>Restaurant</strong> post type, you will see the fields and can enter information into them.</p><figure><img alt="Enter the information into fields." src="https://cdn-images-1.medium.com/max/1000/0*uZCFT41QWLEAHDoM.png" /></figure><h3>Step 3: Create a New Template</h3><p>Go to<strong> Templates</strong> &gt; <strong>Theme Builder</strong>.</p><figure><img alt="Create a new template" src="https://cdn-images-1.medium.com/max/1000/0*n_R8TzDHdsUNGWfA.png" /></figure><p>We will have a list of products, so we should choose the template as a loop. This option is available when you have <a href="https://wordpress.org/plugins/ele-custom-skin/">Elementor Custom Skin</a>.</p><figure><img alt="Choose the template as a Loop." src="https://cdn-images-1.medium.com/max/1000/0*MbZ0ATlaRMBd759T.png" /></figure><p>To have the live preview, you can choose any post of the post type that you want in the <strong>Settings</strong> tab.</p><figure><img alt="Choose any post of the post type in the Settings tab." src="https://cdn-images-1.medium.com/max/1000/0*Wh2UrosbGWR2cTsy.png" /></figure><p>Firstly, I add an <strong>Inner Section</strong> to group some elements that I want to style at once as the featured image, logo, and voucher.</p><figure><img alt="Add an Inner Section to group some elements" src="https://cdn-images-1.medium.com/max/1000/0*lHVzZDApHXL5zGur.png" /></figure><p>It has 2 columns inside so I’ll remove one.</p><figure><img alt="Remove 1 columns in Inner Section." src="https://cdn-images-1.medium.com/max/1000/0*jzUYbjL7hnrrosFZ.png" /></figure><p>Next, I add the <strong>Featured Image</strong> widget into the <strong>Inner Section</strong>.</p><figure><img alt="Add the Featured Image widget into the Inner Section" src="https://cdn-images-1.medium.com/max/1000/0*88hwgdPKXOUuNz6h.png" /></figure><p>Then, to get the value of the <strong>Voucher</strong> field, add a <strong>Text Editor</strong> element and link it to the field following what I’m doing in the below picture.</p><figure><img alt="Click on the Dynamic Tags icon &gt; choose Meta Box Field option in the Post section &gt; choose the field you want." src="https://cdn-images-1.medium.com/max/1024/0*GYqidluoq_UKIuET.gif" /><figcaption>Click on the Dynamic Tags icon &gt; choose Meta Box Field option in the Post section &gt; choose the field you want.</figcaption></figure><p>And then, the value that you input to the corresponding field will display in the preview.</p><p>For the <strong>Logo</strong>, just add an<strong> Image</strong> widget, and choose the source from a <strong>Meta Box field</strong> as well.</p><figure><img alt="Setting for Logo field." src="https://cdn-images-1.medium.com/max/1024/0*gF_tt0vAo4m_1M6j.gif" /></figure><p>Here I set the logo size as<strong> Thumbnail</strong> to scale down the image.</p><figure><img alt="Set the logo size as Thumbnail to scale down the image." src="https://cdn-images-1.medium.com/max/1000/0*8YHcsRmK01qp6XvE.png" /></figure><p>Moving on, out of the <strong>Inner Section</strong>, I add a <strong>Post Title</strong> widget and link it to the <strong>Post URL</strong>.</p><figure><img alt="Add a Post Title widget and link it to the Post URL." src="https://cdn-images-1.medium.com/max/1024/0*zgkDuoSIxJwKvQ22.gif" /></figure><p>The <strong>Address</strong> of the restaurant also will be got from the value of the custom fields in the same way with the <strong>Voucher</strong>. So, add a <strong>Text Editor</strong> and link it to the <strong>Address</strong> field.</p><figure><img alt="Settings for Address field." src="https://cdn-images-1.medium.com/max/1024/0*sH1hdLxpAo5NWaY6.gif" /></figure><p>When users hover over the featured image of the restaurant, I want a text as <strong>View Detail</strong> display, so I add a <strong>Heading</strong> widget here. I also rename the <strong>Title</strong> to <strong>View Detail</strong> and link it to the <strong>Post URL</strong>.</p><figure><img alt="Setting for View Detail field." src="https://cdn-images-1.medium.com/max/1024/0*mxBVIF99cvptfl_l.gif" /></figure><p>The last one, the <strong>Status</strong> is the same as the <strong>Voucher</strong>, so do likewise and link it to the <strong>Status </strong>field.</p><figure><img alt="Setting for Status field." src="https://cdn-images-1.medium.com/max/1024/0*fynAoXqvs7YjqnJ6.gif" /></figure><h3>Step 4: Add a Section for the Latest Products on the Homepage</h3><p>Now, I will add the list of the latest restaurants to this position on the homepage. It is a list of posts, so I drag the<strong> Post</strong> widget to here.</p><figure><img alt="Add the list of the latest products to the position on the homepage" src="https://cdn-images-1.medium.com/max/1000/0*8iL8NZjQ_6DEq7GU.png" /></figure><p>Because I have the Elementor Custom Skin plugin, I have an option to set the skin as <strong>Custom</strong>.</p><figure><img alt="Choose Custom in Skin tab." src="https://cdn-images-1.medium.com/max/1000/0*mRISABNEXcTUNQwW.png" /></figure><p>Then, select the <strong>Default Template</strong> as the template which we have just created.</p><p>Next, in the <strong>Query</strong> section, choose the source as the post type of your products.</p><figure><img alt="In the Query section, choose the source as the post type of your products." src="https://cdn-images-1.medium.com/max/1000/0*kmWjWCn5023XPFGS.png" /></figure><p>Now, the preview shows the posts with exactly the information we want. And the products are in the time order: the latest post first, then the older one without any further configuration.</p><figure><img alt="The result of displaying the latest products section before styling." src="https://cdn-images-1.medium.com/max/1000/0*7qnSQn4r1dXcAYyA.png" /></figure><p>We will style this section in the next step.</p><h3>Step 5: Set CSS Classes for the Elements</h3><p>Before styling my latest restaurants section on the homepage, I set CSS classes for each element in the <strong>Advanced</strong> tab.</p><figure><img alt="In the Advanced tab, set CSS classes to prepare styling for the latest products section." src="https://cdn-images-1.medium.com/max/1024/0*wfhLqalWtzN_d4Yy.gif" /></figure><p>This step is so easy, but it will help in the next steps.</p><h3>Step 6: Create Slider for The Latest Products Section</h3><p>As you’ve seen at the beginning, my latest restaurant section is in a slider. To have it, I use some JS and CSS. But instead of adding them directly to the theme, I’m using the <strong>My Custom Functionality</strong> plugin, so when I change the theme, the slider won’t be affected. You can download this plugin from <a href="https://github.com/srikat/my-custom-functionality">GitHub</a> and install it on your website.</p><h3>Download the JS and CSS Library</h3><p>For the JS and CSS, I use the Slick library. It is also available on <a href="https://github.com/kenwheeler/slick/tree/master/slick">GitHub</a>. It includes several files as you can see here. But, we just need three of them.</p><figure><img alt="Use 3 files CSS and JS in Slick library." src="https://cdn-images-1.medium.com/max/1000/0*UarNVF2jxfrbJuol.png" /></figure><p>Go to the folder of the My Custom Functionality plugin, and upload them into the corresponding JS and CSS folders.</p><figure><img alt="Upload the slick-theme.css file into the css folder of My Custom Functionality plugin" src="https://cdn-images-1.medium.com/max/1000/0*De0wDdjErID6HX_3.png" /></figure><h3>Set Up The Slider Effect</h3><p>Next, to set up the slider effect of Slick Slider, I’ll create a custom.js file in the JS folder, and add this code to it.</p><figure><img alt="Create a custom.js file in the JS folder, and add code to it" src="https://cdn-images-1.medium.com/max/1000/0*83XfNKEexOwEGUgn.png" /></figure><pre><em>jQuery(document).ready(function ($) {<br>    jQuery(&quot;.list-restaurant .ecs-posts&quot;).slick({<br>        infinite: false,<br>        dots: false,<br>        autoplay: false,<br>        speed: 800,<br>        autoplaySpeed: 4000,<br>        slidesToShow: 3,<br>        slidesToScroll: 3,<br>        nextArrow: &#39;&lt;button class=&quot;next-btn&quot;&gt;Next&lt;/button&gt;&#39;,<br>        prevArrow: &#39;&lt;button class=&quot;prev-btn&quot;&gt;Previous&lt;/button&gt;&#39;<br>    });<br>    jQuery(&#39;.status-res .elementor-text-editor&#39;).each(function () {<br>        if (jQuery.trim(jQuery(this).html()) == &#39;Open&#39;) {<br>            jQuery(this).parents(&#39;.status-res&#39;).addClass(&#39;open&#39;);<br>        } else {<br>            jQuery(this).parents(&#39;.status-res&#39;).addClass(&#39;close&#39;);<br>        }<br>    });<br>})</em></pre><p><strong>Explanation</strong>:</p><ul><li>jQuery(&quot;.list-restaurant .ecs-posts&quot;).slick({}): We use it to create a slider with the Slick Slider’s style for the elements in the .list-restaurant .ecs-posts class;</li><li>jQuery(&#39;.status-res .elementor-text-editor&#39;).each(function () {}): It will create a dynamic class depending on the returned values of the restaurant’s status in the section that I put in the status-res class. If the returned value is open, the class will be open. In return, the value is close, the class will be close.</li></ul><h3>Declare the JS and CSS Files</h3><p>Go to the plugin.php file and add this code into the custom_enqueue_files() function:</p><pre>wp_enqueue_style(&#39;slick&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick.css&#39;);<br>wp_enqueue_style(&#39;slick-theme&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/css/slick-theme.css&#39;);<br>wp_enqueue_script(&#39;custom&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/custom.js&#39;, [&#39;jquery&#39;]);<br>wp_enqueue_script(&#39;slick-min&#39;, plugin_dir_url(https://medium.com/__FILE__).&#39;/assets/js/slick.min.js&#39;, [&#39;jquery&#39;]);</pre><p>Now, go to the homepage, my latest restaurants section has already turned into a slider.</p><figure><img alt="The latest products section is displayed as a slider" src="https://cdn-images-1.medium.com/max/1000/0*Vyj_QHyO1ReWHRl3.gif" /></figure><p>But it hasn’t looked good yet. So, it’s time to add some additional CSS.</p><h3>Step 7: Add CSS to Style The Latest Products Section</h3><p>Back to the Template we’ve just created. In the <strong>Navigator</strong>, choose the <strong>Section</strong> element that includes all the elements of the posts we show on the Latest Products section. And move to the <strong>Advanced</strong> tab &gt; <strong>Custom CSS</strong> and add code to the box.</p><figure><img alt="Add CSS to style the latest products section" src="https://cdn-images-1.medium.com/max/1000/0*r3UkN7lluuHndUmC.png" /></figure><p>I uploaded the code to <a href="https://github.com/wpmetabox/tutorials/blob/master/display-latest-posts-with-Elementor/custom.css">GitHub</a>, so you can try it.</p><p>Now, back to the homepage, the slider turned to a beautiful one.</p><figure><img alt="The final result of is display the latest products section" src="https://cdn-images-1.medium.com/max/1000/0*Iu6oJQ5eQPNj7-bB.png" /></figure><h3>Last Words</h3><p>As you see, displaying the <strong>Latest Products</strong> section on the front end <strong>in time order</strong> with <strong>Meta Box and Elementor is so intuitive</strong>. You just need to drag and drop without much coding and can preview the page easily.</p><p>Besides, if you want to try other plugins or compare which way is better, don’t forget to read other articles in this series.</p><p>— — —</p><p>The publication at <a href="https://metabox.io/display-latest-products-section-p2-meta-box-elementor/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3793573ca1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/display-the-latest-products-section-p2-using-meta-box-and-elementor-3793573ca1">Display The Latest Products Section — P2 — Using Meta Box and Elementor</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Category Thumbnails & Featured Images Using Custom Fields]]></title>
            <link>https://medium.com/meta-box/how-to-create-category-thumbnails-featured-images-using-custom-fields-b938ce005aa0?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/b938ce005aa0</guid>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[thumbnail]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 02:47:38 GMT</pubDate>
            <atom:updated>2021-08-10T02:47:38.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Create Category Thumbnails and Featured Images Using Custom Fields" src="https://cdn-images-1.medium.com/max/800/0*hr6K43cu4mG263tu.jpg" /></figure><p><strong>Category Thumbnails</strong> may familiar with someone using a theme that supports this feature. However, for someone who loves something highly customized, you might create it yourself. So, today I bring you a simple solution to not only have this feature but also have beautiful <strong>featured images on Archive pages</strong> as well. Especially, it may be a good way to have high-quality images without slowing your website loading speed.</p><p>This is my example for the tutorial today:</p><figure><img alt="An example for Category Thumbnails" src="https://cdn-images-1.medium.com/max/800/0*-50NlBMaVyLmEBB2.png" /></figure><p><em>Category Thumbnails (look at the Top Destinations section at the bottom)</em></p><figure><img alt="An example for Category Featured Image on an Archive page" src="https://cdn-images-1.medium.com/max/800/0*a9ZOKnp0GvFqHIP_.png" /></figure><p><em>A Category Featured Image on an Archive page</em></p><p>Do they worthy for you to try? Let’s go!</p><h3>Video Version</h3><p><a href="https://youtu.be/pFgElK8pvn0">https://youtu.be/pFgElK8pvn0</a></p><h3>Before Getting Started</h3><p>As the title of the post, I will use custom fields. Of course, Meta Box is on the list. Along with the core framework, which is free on <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>, we also need the following extensions:</p><ul><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>: provides UI to create custom fields;</li><li><a href="https://metabox.io/plugins/mb-term-meta/">MB Term Meta</a>: allows to create custom fields for categories or taxonomies;</li><li><a href="https://metabox.io/plugins/mb-views/">MB Views</a>: in this tutorial, we will use this extension to create a shortcode to display category thumbnails;</li><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>: (optional) you need this extension when you are creating thumbnails for custom taxonomies of a custom post type. Please be noticed that if you are looking for something for taxonomies, please wait for the next tutorial. This tut is for Category only.</li></ul><p>These all extensions are available in the Meta Box AIO, which the Developer and Lifetime licenses included.</p><h3>Create Custom Fields for Saving Image</h3><p>After activating the <a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>, you will have a UI to create custom fields right from the Admin Dashboard.</p><p>Go to the <strong>Custom Fields</strong> menu then create a new field group. Here I created two fields. One is <strong>URL</strong> to save URL. And, one is <strong>Single Image</strong> which allows you to upload an image to the media library.</p><figure><img alt="One is URL to save URL. And, one is Single Image which allows you to upload an image to the media library." src="https://cdn-images-1.medium.com/max/800/0*d2AsmgKhHLKpbDFp.png" /></figure><p>There is no special in settings of them. In case you haven’t been familiar with creating custom fields using Meta Box, we have a video tutorial on it.</p><p><a href="https://youtu.be/_DaFUt92kYY">https://youtu.be/_DaFUt92kYY</a></p><p>You can choose to use one of these fields or both like I did here. It doesn’t matter. The URL field allows you to put links from any website so that your site will not carry those images. Otherwise, the single image field allows you to upload images to the media library. They may have a faster loading speed. But, if you have a significant number of categories or you need high-quality images, that sounds not good for your server.</p><p>One more thing, you must pay attention to the IDs of the fields. We will use them in the next steps. So, let it be something easy to recall and distinguish.</p><p>In the <strong>Settings</strong> tab of the field group, remember to set the <strong>Location</strong> as Taxonomy and Category to assign these fields for Categories.</p><figure><img alt="remember to set the Location as Taxonomy and Category to assign the custom fields for Categories" src="https://cdn-images-1.medium.com/max/800/0*FYwGSZuSC2FLhGuD.png" /></figure><p>Then, go to a <strong>Category Editor</strong> page, you will see the fields. I filled in the URLs for all the categories instead of uploading images.</p><figure><img alt="go to a Category Editor page, you will see the custom fields for thumbnails and featured images" src="https://cdn-images-1.medium.com/max/800/0*HsxrXj_hfP-iQleZ.png" /></figure><h3>Display List of Categories with Thumbnails in the Frontend</h3><p>We will need support from the <a href="https://metabox.io/plugins/mb-views/">MB Views</a> for this task. Go to Views and create a new view.</p><figure><img alt="Go to Views and create a new view to display the list of category thumbnails" src="https://cdn-images-1.medium.com/max/800/0*y-ribtc5HK8FgRHd.png" /></figure><p>In the <strong>Template</strong> tab, I used this code:</p><pre>{% set args = {hide_empty: false} %}<br>{% set categories = mb.get_categories( args ) %}<br>&lt;div class=&quot;thumbnail-images&quot;&gt;<br>    {% for category in categories %}<br>        &lt;div class=&quot;item&quot;&gt;<br>            &lt;div class=&quot;overlay-thumbnail-categories&quot;&gt;&lt;/div&gt;<br>            &lt;div class=&quot;category-title&quot;&gt;&lt;a href=&quot;{{ mb.get_category_link( category.term_id ) }}&quot;&gt;{{ category.name }}&lt;/a&gt;&lt;/div&gt;<br>    {% set image_upload = mb.get_term_meta( category.term_id, &#39;thumbnail_images_category&#39;, true ) %}<br>    {% set image_url = mb.get_term_meta( category.term_id, &#39;url_images_category&#39;, true ) %}<br>    {% if image_upload %}<br>        {% set image_upload_link = mb.wp_get_attachment_image_src( image_upload, &#39;medium&#39; ) %}<br>        &lt;img src=&quot;{{ image_upload_link[0] }}&quot;&gt;<br>    {% elseif image_url %}<br>        &lt;img src=&quot;{{ image_url }}&quot;&gt;<br>    {% else %}<br>        &lt;img src=&quot;http://demo1.elightup.com/test-metabox/wp-content/uploads/2020/11/oriental-tiles.png&quot;&gt;<br>    {% endif %}<br>        &lt;/div&gt;<br>{% endfor %}<br>&lt;/div&gt;</pre><p>In there:</p><ul><li>get_categories( args ): to know which category is getting data;</li><li>&lt;a href=&quot;{{ mb.get_category_link( category.term_id ) }}&quot;&gt;{{ category.name }}&lt;/a&gt;: to get the link of the corresponding category by ID. At the same time, display the category name and hyperlink it;</li><li>get_term_meta (): to get values of the fields from the corresponding category by category.term_id. &#39;thumbnail_images_category&#39; and &#39;url_images_category&#39; are IDs of fields;</li><li>wp_get_attachment_image_src (): to get the link of the uploaded image of the corresponding category;</li><li>&lt;img src=&quot;{{ }}&quot;&gt;: to display the image by the link assigned to the variable.</li></ul><p>In the event that I did neither insert a link nor upload an image, the last line of code will display a default image.</p><p>This view will be set in the type of Shortcode so that it will auto-generate a shortcode. You can use this shortcode to easily display the list of the category with thumbnails everywhere you want. It seems like simplify the process a lot.</p><figure><img alt="This view will be set in the type of Shortcode so that it will auto-generate a shortcode." src="https://cdn-images-1.medium.com/max/800/0*OnS0k-s5pcBB2cpK.png" /></figure><p>Paste the shortcode to my homepage.</p><figure><img alt="You can use this shortcode to easily display the list of the category with thumbnails everywhere you want. It seems like simplify the process a lot." src="https://cdn-images-1.medium.com/max/800/0*BNoNqrCJEnp3ub2V.png" /></figure><p>Then, here are the thumbnail images and titles of the categories on the homepage.</p><figure><img alt="the thumbnail images and titles of the categories on the homepage" src="https://cdn-images-1.medium.com/max/900/0*kN6UVZ4uLhR1_Eqm.gif" /></figure><p>Back to the view, add some code to the CSS tab to style this section.</p><figure><img alt="Back to the view, add some code to the CSS tab to style this section." src="https://cdn-images-1.medium.com/max/800/0*cQsPwBsqJMCGO5vt.png" /></figure><p>Here is the code I used:</p><pre>body {<br>    overflow-x: hidden;<br>}</pre><pre>.thumbnail-images {<br>    display: flex;<br>    flex-wrap: wrap;<br>    justify-content: center<br>}<br>.overlay-thumbnail-categories {<br>    position: absolute;<br>    top: 0;<br>    bottom: 0;<br>    left: 0;<br>    right: 0;<br>    height: 100%;<br>    width: 100%;<br>    border-radius: 20px;<br>    background-image: radial-gradient(ellipse, rgb(0 0 0 / 63%), rgb(0 0 0 / 55%), rgb(0 0 0 / 50%), rgb(0 0 0 / 42%), rgb(0 0 0 / 35%), rgb(0 0 0 / 20%));<br>}<br>.item {<br>    width: 31.5%;<br>    position: relative;<br>    margin: 10px;<br>    align-content: space-between;<br>}<br>.item img {<br>    width: 100%;<br>    height: 300px;<br>    object-fit: cover;<br>    border-radius: 20px;<br>}<br>.category-title {<br>    position: absolute;<br>    left: 50%;<br>    top: 50%;<br>    transform: translate(-50%, -50%);<br>    padding: 10px;<br>    font-family: &#39;Dancing Script&#39;, cursive;<br>    font-size: 30px;<br>}<br>.category-title &gt; a {<br>    text-decoration: none !important;<br>    color: #f0a030;<br>}</pre><p>All the above classes are created in the code which I put into the <strong>Template</strong> tab.</p><p>After that, the Top Destinations has a new better look. You see!</p><figure><img alt="After adding CSS, the list of Category Thumbnails has a new better look" src="https://cdn-images-1.medium.com/max/800/0*6MjMlooGibYPvAtf.png" /></figure><h3>Display the Featured Images for Categories on Archive Pages</h3><p>This is an Archive page before adding the featured image.</p><figure><img alt="This is an Archive page before adding the featured image." src="https://cdn-images-1.medium.com/max/800/0*a8Bl1Yq_cGCkRVbN.png" /></figure><p>We need to touch the theme file to display the images from the fields to the top of this page. Go to the archive.php file. It is the template file for the archive pages.</p><p>Add this code after the header and the first div tag.</p><figure><img alt="Add code to change the template of theme to display the images from the custom fields as a featured image" src="https://cdn-images-1.medium.com/max/800/0*yIAmraD0oohUZv3e.png" /></figure><pre>&lt;?php<br>    $categories= get_the_category();<br>    $background_image = get_term_meta( $categories[0]-&gt;term_id, &#39;thumbnail_images_category&#39;, true );<br>    if ($background_image) {<br>        $link_image = wp_get_attachment_image_src( $background_image, &#39;full&#39; );<br>        $link_image_source = $link_image[0];<br>    }<br>    else {<br>        $link_image_source = get_term_meta( $categories[0]-&gt;term_id, &#39;url_images_category&#39;, true );<br>    }<br>?&gt;<br>&lt;div class=&quot;thumbnail-container&quot;&gt;<br>    &lt;img class=&quot;thumbnail-cat&quot; src=&quot;&lt;?php echo $link_image_source ?&gt;&quot;&gt;<br>    &lt;div class=&quot;thumbnail-overlay&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><p>In there:</p><ul><li>get_the_category(): to know which archive page the user is;</li><li>get_term_meta (): get the value of the field;</li><li>&#39;thumbnail_images_category&#39; and &#39;url_images_category&#39; are IDs of the created custom fields;</li><li>wp_get_attachment_image_src (): to get the link of the uploaded image;</li><li>src=&quot;&lt;?php echo $link_image_source ?&gt;: to display the image from the link which is the value of the $link_image_source variable.</li></ul><p>Then, the featured image will display as below:</p><figure><img alt="the featured image displays on archive page" src="https://cdn-images-1.medium.com/max/800/0*O7xaV5-l2zw6VEdT.png" /></figure><p>Go back to the theme files, add some CSS code to style this section, including the featured image, the category title, and the description.</p><figure><img alt="Add some CSS code to style this section, including the featured image, the category title, and the description" src="https://cdn-images-1.medium.com/max/800/0*pKKP16kFA2VK4NU-.png" /></figure><pre>.thumbnail-container {<br>    position: relative;<br>}<br>.thumbnail-cat {<br>    width: 100%;<br>    height: 85vh;<br>    object-position: 100% 70%;<br>    object-fit: cover;<br>    display: block;<br>    -webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);<br>    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 80%);<br>}<br>.thumbnail-overlay {<br>    position: absolute;<br>    top: 0;<br>    bottom: 0;<br>    left: 0;<br>    right: 0;<br>    height: 100%;<br>    width: 100%;<br>    background: linear-gradient(rgba(0, 0, 0, 0.63) , rgba(255, 255, 255, 0));<br>}<br>.page-title.ast-archive-title {<br>    margin-top: -3.5em;<br>    font-weight: 500;<br>    font-family: &#39;Dancing Script&#39;, Cursive;<br>    color:#f0a030;<br>}<br>.ast-archive-description &gt; p {<br>    font-size: 17px;<br>    font-style: italic;<br>}</pre><p>So now, it turns to this look:</p><figure><img alt="The featured image, the category title, and the description turn to a new graceful look" src="https://cdn-images-1.medium.com/max/800/0*fcYzBsAlM_99Y-DV.png" /></figure><p>That’s all for today’s tutorial. What do you think?</p><h3>Last Words</h3><p>FYI, if you want to apply thumbnails or featured images for taxonomies of a custom post type, even with the different website builders, the solution is quite the same. <strong>Most cases will be easier when you have </strong><a href="https://metabox.io/plugins/mb-views/"><strong>MB Views</strong></a><strong>.</strong> We’re having a comprehensive tutorial on it in the upcoming post. Keep track of our blog to get its notice soon!</p><p>Furthermore, if you have any suggestions, let us know. We’re so happy to have any idea from you!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/create-category-thumbnails-featured-images-wordpress/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b938ce005aa0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-create-category-thumbnails-featured-images-using-custom-fields-b938ce005aa0">How to Create Category Thumbnails &amp; Featured Images Using Custom Fields</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full Site Editing (FSE) — All You Need To Know — P1 — Overview]]></title>
            <link>https://medium.com/meta-box/full-site-editing-fse-all-you-need-to-know-p1-overview-79990d442584?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/79990d442584</guid>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[other]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[site]]></category>
            <category><![CDATA[editing]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 02:33:06 GMT</pubDate>
            <atom:updated>2021-08-03T02:33:05.048Z</atom:updated>
            <content:encoded><![CDATA[<h3>Full Site Editing (FSE) — All You Need To Know — P1 — Overview</h3><figure><img alt="Full Site Editing FSE All You Need To Know Overview" src="https://cdn-images-1.medium.com/max/800/0*N2kRq2p0hhuPOJTH.jpg" /></figure><p>When WordPress 5.0 was introduced at the end of 2018, the familiar Classic editor of WordPress was replaced by a new one called <strong>Gutenberg</strong>. This new editor is a significant change in creating content on WordPress websites by using blocks instead. But that’s just the beginning.</p><p>Do you remember the <a href="https://gutenbergtimes.com/mullenweg-on-gutenberg-roll-out-plan/">four phases of Gutenberg</a>?</p><ol><li>Easier Editing — already in Core, refinement is ongoing</li><li>Customization — Full Site editing, Block Patterns, Block Directory, Block based themes</li><li>Collaboration — A more Google Doc co-authoring;</li><li>Multi-lingual — Core implementation for Multi-lingual sites.</li></ol><p>After nearly 3 years, it is likely that Gutenberg gradually completed phase 2 by releasing the most important feature — <strong>Full Site Editing</strong> in <a href="https://wordpress.org/news/2021/07/tatum/">WordPress 5.8</a> on July 20th, 2021. In fact, it was first introduced in early 2020 via an experiment program.</p><h3>What is Full Site Editing?</h3><p><strong>Full Site Editing (FSE)</strong> is a concept referring to the ability to <strong>build an entire website based on using blocks</strong>. Actually, it is a collective term for a set of new WordPress features that are under development: Block themes, Template editing, and Global styles.</p><p>With FSE, there is no need to move back and forth between Customizer, Widget, Menu, … to customize your website anymore. It provides a place named <strong>Site Editor</strong> to do all the things those sections do. It means that <strong>you can create all pages or all your website from only one place</strong>. And with FSE, website building becomes so simple, just <strong>drag and drop blocks</strong>.</p><p>In the future, sections like Customizer may also no longer exist on WordPress. Instead, <strong>blocks will be everywhere</strong>, not only in the content area as ever before.</p><figure><img alt="you can create all pages or all your website from only one place of Full Site Editing FSE" src="https://cdn-images-1.medium.com/max/1024/0*4Gw4ov1CuNLlouC-.png" /></figure><p>WordPress users probably need to change their habits. No matter who you are, a developer, a designer, a theme or plugin author, or just a user, you should follow this trend.</p><h3>Common concepts of Full Site Editing (FSE)</h3><h3>Blocks</h3><p>Blocks have not been strange anymore since Gutenberg was born. They can be paragraphs, images, videos, audios, … in a post. You can drag and drop to move and arrange them in order or columns, even groups.</p><p>Now, blocks have more useful features in FSE. You can use them to create global elements such as site logo, tagline, header, footer, menu, sidebar, etc. Blocks are no longer a part of the content only but gradually become primary sections to build a complete WordPress website.</p><p>Whether Blocks for content or creating websites, they allow you to create both static and dynamic content. For dynamic content, Block will display the corresponding content to different users or in different positions, … as any rule you set. For example, this Query Loop Block displays a list of blog posts or CPT.</p><figure><img alt="example for dynamic data of blocks: Query Loop Block displays a list of blog posts or CPT" src="https://cdn-images-1.medium.com/max/1024/0*IhCyP4nMwa7grKNZ.png" /></figure><h3>Block Patterns and Reusable Blocks</h3><p><a href="https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/">Block Patterns</a> group different blocks together in a complete layout. It means that all these blocks have been created, arranged, formatted, configured, … then combined into a defined and refined sample that can be used immediately.</p><p>You can save Block Patterns for reuse later on both posts and pages. Therefore, you can create complicated sections of content for posts or pages with just a few clicks. So easy!</p><p>When applying a Block Pattern, you can edit its content or settings without affecting other sections created before from it.</p><figure><img alt="When applying a Block Pattern of FSE, you can edit its content or settings without affecting other sections created before from it" src="https://cdn-images-1.medium.com/max/1024/0*odTX72sK-MpuDkbI.png" /></figure><p>Almost similar to Block Patterns are Reusable Blocks. Users can create a block with predefined content and settings, then save it to reuse. Such blocks are called Reusable Blocks. However, for this type of block, once you change it from a page, it will lead to the changes of all these blocks on the website. This is slightly different from Block Patterns.</p><p>It is recommended to combine Block Patterns and Reusable Blocks for more convenient and optimal use, not just using either.</p><h3>Templates / Block Templates</h3><p>As we know, a WordPress website can have various templates, and each one is a separate file. <a href="https://developer.wordpress.org/themes/basics/template-hierarchy/">Template Hierarchy</a> decides which template or set of templates should be used to display the page.</p><p>Templates have been in the form of PHP files so far. But now HTML is used in FSE. The content of template files now is a list of block items, so they are called Block Templates.</p><figure><img alt="in FSE, the content of template files now is a list of block items, so they are called Block Templates" src="https://cdn-images-1.medium.com/max/1024/0*dE6Pr-1f1yy76J8Y.png" /></figure><p>A template of a traditional theme would have this structure:</p><pre>├── theme-name<br>│ ├── template-parts<br>│ │ ├── content.php<br>│ ├── templates<br>│ │ ├── template-cover.php<br>│ │ ├── template-full-width.php<br>│ ├── index.php<br>│ ├── style.css</pre><p>An FSE theme would have this structure:</p><pre>├── theme-name<br>│ ├── block-template-parts<br>│ │ ├── header.html<br>│ │ ├── footer.html<br>│ ├── block-templates<br>│ │ ├── index.html<br>│ ├── index.php<br>│ ├── style.css</pre><h4>User-Defined Template</h4><p>Users can create their own templates from the Site Editor thanks to FSE. They can see live changes on the website when doing so. So that, they will not need to create any child theme, touch code, or hire a developer as they used to.</p><p>In particular, these user-defined templates will be saved to the database as a custom post type named wp_template. Thus, they can be exported and imported into another website for reusing. It is so convenient to use the same templates if you have a bunch of websites.</p><figure><img alt="Users can create their own templates from the Site Editor thanks to FSE" src="https://cdn-images-1.medium.com/max/1024/0*nae5fzgiBmI9igvE.png" /></figure><h4>Block Themes / Block-Based Themes</h4><blockquote>“A block theme is a WordPress theme with templates entirely composed of blocks so that in addition to the post content of the different post types (pages, posts, …), the block editor can also be used to edit all areas of the site: headers, footers, sidebars, etc.”<em> — </em><a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/block-theme-overview/"><em>Gutenberg Handbook</em></a><em>.</em></blockquote><p><strong>Note:</strong> From the early days of the experiment, <strong>Block Themes</strong> were called <strong>Block-Based Themes</strong>, so you may see this name somewhere.</p><p>For instance, the <a href="https://wordpress.org/themes/tt1-blocks/">TT1 Blocks</a> theme is a Block Theme version of Twenty Twenty-One. It has the following file structure:</p><figure><img alt="Structure of a Block Theme, TT1 Blocks theme" src="https://cdn-images-1.medium.com/max/1024/0*kPwvd190UKXw3Nyf.png" /></figure><p>You can see that the core of these block themes will be block templates and block template parts. And, of course, they all are in the form of HTML files. These sections keep the same concept as in the traditional themes. But, the Block Template Parts are separated into individual modules because they will appear more than once in different templates.</p><p>Currently, there are not too many block themes, and most of them are trials. You can refer to:</p><ul><li><a href="https://wordpress.org/themes/tt1-blocks/">TT1 Blocks</a></li><li><a href="https://github.com/WordPress/theme-experiments/tree/master/twentytwenty-blocks">Twenty Twenty Blocks</a></li><li><a href="https://github.com/aristath/q">The Q theme</a></li><li><a href="https://wordpress.org/themes/block-based-bosco/">Block-based Bosco</a></li></ul><h3>Global Styles</h3><p>Global Styles has been integrated into the Site Editor. You can change the website appearance by editing every element of the entire website in Global Styles such as color, size, typo, background, etc., or choose the style by each block type without access to each page or Customizer.</p><p>That’s why it is reckoned that Customizer will be omitted in the future because Global Styles can replace it.</p><figure><img alt="Global Styles has been integrated into the Site Editor of FSE" src="https://cdn-images-1.medium.com/max/1024/0*fi7keGId8DLKMcy4.png" /></figure><p>An interesting thing is that we will use <strong>theme.json</strong> file to create options in the Global Styles panel. It is a configuration file located in the root directory of the theme and used to create presets. If you have an intention of developing a block theme, learn more about <strong>theme.json</strong> <a href="https://fullsiteediting.com/lessons/global-styles/#h-the-theme-json-file">here</a>.</p><h3>How to experience Full Site Editing (FSE)</h3><p>Do you want to try FSE? It is essential to know that although WordPress 5.8 has FSE, it hasn’t included all the existing FSE features yet. You need to use the MVP version if you want to experience more.</p><p>The MVP is offered via the <a href="https://make.wordpress.org/test/handbook/full-site-editing-outreach-experiment/">FSE Outreach Program</a>. You can join it to update and early experience the new versions. To test FSE, you will need the following:</p><ul><li>Recommend the local install;</li><li>WordPress, versions from 5.7.1;</li><li>A block theme (choose one from the above list);</li><li><a href="https://wordpress.org/plugins/gutenberg/">The Gutenberg plugin</a>, versions from 10.5;</li></ul><p>After installing, you will see the Site Editor (beta) menu in your Dashboard.</p><figure><img alt="After installing, you will see the Site Editor (beta) menu in your Dashboard" src="https://cdn-images-1.medium.com/max/1024/0*YPEvFrfSAcefSYg0.png" /></figure><p>Let’s start to dig into FSE.</p><p>FYI, you can also refer to the below tutorial video to see FSE in practice and experience of other developers in the community:</p><ul><li>Enrique Piqueras: <a href="https://youtu.be/JyX2toCQaGk?t=336">Themes and the Full Site Editing experience for WordPress (experimental)</a> (23/01/2020);</li><li>Kjell Reigstad: <a href="https://youtu.be/6IRSHypI_ew?t=697">Block-Based Theme / Full-Site Editing</a> (26/06/2020);</li><li>Joen Asmussen: <a href="https://www.youtube.com/watch?v=5FYv0sUec-A">Demo of the Site Editor at State of the Word</a> (17/12/2020);</li><li>Kjell Reigstad: <a href="https://www.youtube.com/watch?v=S-6c-TrTC6Y">Introduction into block-based Themes</a> (20/01/2021).</li></ul><p>If you want to share your experience about FSE, join the <a href="https://make.wordpress.org/test/handbook/full-site-editing-outreach-experiment/">FSE Outreach Program</a>, <a href="https://github.com/wordpress/gutenberg/">Github</a>, or <a href="https://wordpress.slack.com/archives/C015GUFFC00">#fse-outreach-experiment</a> on Slack.</p><h3>Personal Thoughts About FSE</h3><p>By releasing FSE, it seems that WordPress is tending to cater to a larger group of users who are non-coding. WordPress is gradually simplifying the website building process with simple drag and drop operations and no touching code so that anyone can use it.</p><p>There were quite a few barriers in customizing whether they were tiny edits on separated blocks or the website. Now, FSE helps WordPress users to create layouts in a much more flexible and convenient way.</p><p>As for <strong>website implementers</strong>, this will probably be a prominent competitive advantage of WordPress compared to other platforms on the market such as Wix, Weebly, or Squarespace.</p><p>How about <strong>designers and agencies</strong>? They will have more time creating designs with better UI/UX, more unique, more conformity with the customer requirements. Quite a lot of benefits, alright?</p><p>For those <strong>who make themes or plugins</strong> like me, FSE is likely to be a little disadvantaged. It solves most of the tasks done by theme developers. Meanwhile, plugins also may change to be compatible. However, in fact, I am not too worried about this change at all. FSE is just in the early stages. There will be more time for us to learn, adapt, and gradually change the products. So, stay tuned, keep updating further information, and reading the documents related to FSE.</p><h3>Last but not least</h3><p>I hope that this article will help you have a better overview of the upcoming trends in WordPress as well as understand Full Site Editing (FSE). Since this project is still under development and testing, I will regularly update news about it on this blog.</p><p>This is such an interesting topic that lots of people pay attention to, so I’ll not stop here. I’m going to have more in-depth articles on comparing and evaluating the efficiency and speed of websites when using Gutenberg, or resources related to block themes. Keep track of our blogs!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/full-site-editing-fse-p1-overview/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79990d442584" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/full-site-editing-fse-all-you-need-to-know-p1-overview-79990d442584">Full Site Editing (FSE) — All You Need To Know — P1 — Overview</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Buttons with Dynamic Link using Custom Fields]]></title>
            <link>https://medium.com/meta-box/how-to-create-buttons-with-dynamic-link-using-custom-fields-8bcd050e25ee?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/8bcd050e25ee</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[button]]></category>
            <category><![CDATA[youtube-video]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Tue, 20 Jul 2021 02:33:07 GMT</pubDate>
            <atom:updated>2021-07-20T02:33:07.598Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Create Buttons with Dynamic Link using Custom Fields" src="https://cdn-images-1.medium.com/max/800/0*lJp8I9n3vwH3iRNk.jpg" /></figure><p>Sometimes you may need a button that can show different links in different posts. That’s a button with dynamic link. There are different ways to create it, one of them is using custom fields. Links will be saved into custom fields then pulled out and put into the button automatically. And, that’s where the Meta Box plugin comes in handy.</p><p>For instance, I have a website about <a href="https://freewpthemes.reviews/">theme reviews</a> here. Each post about a theme has buttons to their own demo and download pages. They are dynamic links.</p><figure><img alt="A website about theme reviews that have buttons with dynamic link" src="https://cdn-images-1.medium.com/max/1024/0*r01rK7oiucG0qomu.png" /></figure><p>Let’s find out how to create those buttons.</p><h3>Before Getting Started</h3><p>As I said, <a href="https://wordpress.org/plugins/meta-box/">Meta Box</a> is the first tool we put on the list.</p><p>If you love UI, <a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a> is the next one for having UI on the dashboard. It’s available in the Meta Box AIO or MB Core, so if you’ve had one of them, just check to make sure that you’ve already enabled the Meta Box Builder extension.</p><p>If you are using <a href="https://metabox.io/plugins/mb-elementor-integrator/">Elementor</a> or <a href="https://metabox.io/plugins/meta-box-beaver-themer-integrator/">Beaver Builder</a>, please activate the corresponding integration from Meta Box. For others as Oxygen or Bricks, just go ahead.</p><p>In the event that you don’t use any website builder, you may need <a href="https://metabox.io/plugins/mb-views/">MB Views</a>.</p><p>I’m going to have a comprehensive tutorial for both non-using-page-builder and using page builders such as Oxygen, Beaver Builder, and Bricks as following.</p><h3>Video Version</h3><p><a href="https://youtu.be/8sD-Lyy6-5c">https://youtu.be/8sD-Lyy6-5c</a></p><h3>Create Custom Fields for URLs</h3><p>First, we need custom fields for saving URLs for each post. If you’ve had <a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a> in your pocket, you will have a UI on the backend to create custom fields visually. Otherwise, please go to the <a href="https://metabox.io/online-generator/">Online Generator</a>, create fields, generate code, then copy it to get the fields.</p><p>They are quite simple with type is URL and there are no special settings.</p><figure><img alt="Meta Box Builder help to have a UI on the backend to create custom fields visually to have URL button" src="https://cdn-images-1.medium.com/max/1024/0*xEAiWbMoMn6EYztl.png" /></figure><p>After having these fields, please go to post, input some links. That way you will have data to check if the buttons work.</p><h3>Create Buttons Without Using any Page Builder</h3><p>For someone who is not using any page builder on their site, this part may help. <a href="https://metabox.io/plugins/mb-views/">MB Views</a> from Meta Box will help to create a button easier with a shortcode.</p><p>Just go to <strong>Views</strong> and create a new view with this code:</p><pre>&lt;a class=&quot;wp-block-button__link&quot; href=&quot;{{ post.view_demo }}&quot;&gt;<br>    View demo<br>&lt;/a&gt;<br>&lt;a class=&quot;wp-block-button__link&quot; href=&quot;{{ post.download }}&quot;&gt;<br>    Download<br>&lt;/a&gt;</pre><p>In there, view_demo and download are the IDs of the custom fields that we’ve created above. By the way, because I’m using the <a href="https://gretathemes.com/wordpress-themes/estar/">eStar</a> theme, so I must use the wp-block-button__link class to create buttons.</p><p>The view will generate a shortcode as you see in the below image. Just copy and embed it somewhere.</p><figure><img alt="The view will generate a shortcode for the URL button" src="https://cdn-images-1.medium.com/max/1024/0*2SfrEcM-Xi0lpWc6.png" /></figure><p>For instance, I pasted it to a sidebar on the single blog post page and got these buttons.</p><figure><img alt="Display buttons on sidebar with dynamic link" src="https://cdn-images-1.medium.com/max/1024/0*aao4BRsDXwLVP9Ea.png" /></figure><p>Note that this look of the button is from the theme default.</p><h3>Create Buttons with Dynamic Link using Oxygen</h3><p>I’ve already pre-made a template using <a href="https://oxygenbuilder.com/">Oxygen</a>. It is applied to blog posts.</p><p>I will add two buttons right under the featured image of the post. However, before creating any button, we need to set a container for them.</p><figure><img alt="I will add two buttons right under the featured image of the post in this template by Oxygen" src="https://cdn-images-1.medium.com/max/1024/0*n4pJjP6HdS-9yQmC.png" /></figure><p>Now, add a button. At the end of the URL section, there is a button linked to dynamic data. Click it, then choose <strong>Meta / Custom Field</strong> in the <strong>Post</strong> section. Next, Scroll your mouse until you find out the ID of the wanted field to connect to the button.</p><figure><img alt="connect the button to a Meta Box custom fields to make it dynamic link" src="https://cdn-images-1.medium.com/max/1024/0*YENkI3w7ewPrE05n.gif" /></figure><p>The remaining thing to do is styling the button as you want.</p><figure><img alt="style the URL button as you want" src="https://cdn-images-1.medium.com/max/1024/0*i_-c_AMSKcYsfJKs.gif" /></figure><p>I also created another one with a new style and linked it to another field. And, here they are in a post, with links.</p><figure><img alt="buttons with dynamic URL created by Oxygen and Meta Box custom fields" src="https://cdn-images-1.medium.com/max/1024/0*w_ND1eQki0yYdqLs.png" /></figure><h3>Create Buttons with Dynamic Link using Beaver Builder</h3><p>On another website, I also have a pre-made template by <a href="https://www.wpbeaverbuilder.com/">Beaver Builder</a> with the same location and style as the one made by Oxygen. The buttons also will be under the featured image.</p><p>I also add columns to set the layout first, then add a button. There is also a <strong>Link</strong> section for inserting a static link in the button’s settings. But, to get the URLs from Meta Box fields, please click the plus icon.</p><figure><img alt="connect the custom fields of Meta Box to the button in Beaver Builderto make it dynamic" src="https://cdn-images-1.medium.com/max/1024/0*kmyQC_ajb3ITelXj.png" /></figure><p>You will see the <strong>Meta Box Field</strong> option in the drop-down list. Choose it by clicking <strong>Connect</strong>.</p><figure><img alt="You will see the Meta Box Field option in the drop-down list of Beaver Builder" src="https://cdn-images-1.medium.com/max/1024/0*-D3RsQUS8y8CtEq3.png" /></figure><p>Then, choose the name of the field you want.</p><p>The last thing, style your button. That’s all.</p><p>To have another button, you can duplicate this one to save time, then reconnect it to another field as well as restyle it.</p><figure><img alt="reconnect the button to another custom fields in Beaver Builder to auto get data" src="https://cdn-images-1.medium.com/max/1024/0*2AIJZBkrW6ZU4tP9.gif" /></figure><p>Now, go to a post, you will see the buttons with links.</p><figure><img alt="Buttons with dynamic URL created by Beaver Builder and Meta Box custom fields" src="https://cdn-images-1.medium.com/max/1024/0*PtSZMozTimstHAhf.png" /></figure><h3>Create Buttons with Dynamic Link using Bricks</h3><p>The last website builder in this tutorial is <a href="https://bricksbuilder.io/">Bricks</a> with the same template and position for buttons. In the same way, add a container with 4 columns first then buttons.</p><p>Different from other page builders, Bricks allows you to choose the type of link on a dropdown list. To get data from custom fields of Meta Box, please choose <strong>Dynamic Data</strong>.</p><figure><img alt="Buttons with dynamic URL created by Beaver Builder and Meta Box custom fields" src="https://cdn-images-1.medium.com/max/1024/0*tmWVBXL4ppz8q3kN.png" /></figure><p>After that, you will see Meta Box is suggested with the name of custom fields following. Choose one as we want.</p><figure><img alt="Meta Box is suggested with the name of custom fields following" src="https://cdn-images-1.medium.com/max/1024/0*Fjy6ns_Nt_zj1Q7d.png" /></figure><p>Bricks will render a corresponding link to this preview post that you can check if the data is correct.</p><figure><img alt="Bricks will render a corresponding link to this preview post that you can check if the data is correct." src="https://cdn-images-1.medium.com/max/1024/0*H0ey9F33-zwKHV13.png" /></figure><p>After that, all the work is styling.</p><figure><img alt="style the URL button with Bricks" src="https://cdn-images-1.medium.com/max/1024/0*snQeLvhY3gAVTKaH.gif" /></figure><p>Then, I’ve got an ace button in the preview. Let’s duplicate it to have a new one. I’ll change the data’s source and restyle this new button.</p><figure><img alt="create new URL button, reconnect to custom fields then restyle in Bricks" src="https://cdn-images-1.medium.com/max/1024/0*PrE1tykACh0-pOv4.gif" /></figure><p>Finally, here they are on a post.</p><figure><img alt="Buttons with dynamic link created by Bricks and Meta Box custom fields" src="https://cdn-images-1.medium.com/max/1024/0*NRrbqzUPZfESMRFx.png" /></figure><h3>Last Words</h3><p>These are just small tips for creating buttons with dynamic links. By the way, we also hope that you know somewhat how to connect custom fields created by Meta Box to a page builder element. Do you find it work for you?</p><p>If you have any questions, please feel free to leave us a comment below. And, remember to keep track of our blog to have more tutorials.</p><p>— — —</p><p>The publication at <a href="https://metabox.io/create-button-dynamic-link-using-custom-fields/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bcd050e25ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-create-buttons-with-dynamic-link-using-custom-fields-8bcd050e25ee">How to Create Buttons with Dynamic Link using Custom Fields</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Online Admission Form for School or University]]></title>
            <link>https://medium.com/meta-box/how-to-create-online-admission-form-for-school-or-university-b3794f19d7a3?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/b3794f19d7a3</guid>
            <category><![CDATA[admissions]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[custom]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Mon, 19 Jul 2021 02:03:16 GMT</pubDate>
            <atom:updated>2021-07-19T02:03:14.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Create Online Admission Form for School or University" src="https://cdn-images-1.medium.com/max/1024/0*YKAU1grYKyMKkibb.jpg" /></figure><p>Technology has been applied more and more popularly, even in education, and led to obvious changes in this special field. Notably, when the Covid-19 pandemic broke out and caused serious impacts on our lives, education institutions mostly started online teaching classes. As a result, <strong>school admission also can be done online</strong>. Students do not need to go to schools to hand in their profiles anymore. They can stay at home, and fill in their <strong>online admission forms</strong>. This can save expenses for traveling and delivery, as well as reduce risks of exposure. On the other hand, it helps the school office easily <strong>digitize the student’s data</strong>.</p><p>In this post, we are going to create an admission form for a university like that.</p><figure><img alt="An online admission form for a university" src="https://cdn-images-1.medium.com/max/1024/0*zls6wFQ__sdRhXmB.png" /></figure><p><em>Please be informed that every picture or information used in this tutorial is just for the illustration purpose. It’s not about any specific individual or organization.</em></p><h3>Before Getting Started</h3><p>An admission form usually has a lot of custom fields to be filled in, so I definitely need <a href="https://wordpress.org/plugins/meta-box/">Meta Box</a> to make a submission form. I also need these extensions:</p><ul><li>MB Custom Post Types &amp; Custom Taxonomies;</li><li>Meta Box Builder;</li><li>Meta Box Group;</li><li>Meta Box Columns;</li><li>Meta Box Geolocation;</li><li>Meta Box Conditional Logic;</li><li>MB Frontend Submission;</li><li>MB Views.</li></ul><p>All of these extensions are available in <strong>Meta Box AIO</strong> when you have <strong>Developer Bundle</strong> or <strong>Lifetime Bundle</strong> of <a href="https://metabox.io/pricing/">Meta Box</a>. We will need a lot of extensions so I suggest you get either of those bundles to save money.</p><h3>Video Version</h3><p><a href="https://youtu.be/4m64-vrYW5A">https://youtu.be/4m64-vrYW5A</a></p><h3>Step 1: Create a New Custom Post Type</h3><p>I will save the information of each student in one post of a new post type, which can be called <strong>Student Info</strong>.</p><p>To create this post type, we will need the <a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a> extension of Meta Box. Go to <strong>Meta Box &gt; Post Types &gt; Add New</strong> and enter the information for your new post type.</p><p><a href="https://youtu.be/-oYrHGOri4w">https://youtu.be/-oYrHGOri4w</a></p><h3>Step 2: Add Custom Fields for the Admission Form</h3><h3>Content and the Type of Fields</h3><p>Regularly, an admission form may have a lot of fields for students to fill in, like personal information, address, contacts, family information, choice of major, medicine information, etc. It is up to the management strategies and demands of each school or university.</p><p>Here I just add some basic fields like in the above image. Most of those fields are the Text or Number fields. In some special others, they might be a little different. If you want to know more about adding custom fields, please take a look at this:</p><p><a href="https://youtu.be/_DaFUt92kYY">https://youtu.be/_DaFUt92kYY</a></p><p>After adding all of them, you can add a new post in the <strong>Student Info</strong> post type, and you will see they look like this:</p><figure><img alt="All the custom fields for the admission form display in the post editor in the backend" src="https://cdn-images-1.medium.com/max/1024/0*8G36-hhxO-W3uUHv.png" /></figure><p>If you keep this layout for the fields, each field will be a line on the frontend as the same as you see here. I think it is not appropriate, because people will find it difficult to follow and manipulate.</p><p>Thus, I will adjust a little bit by grouping the fields and setting them into columns.</p><h3>Set Custom Fields into Groups and Columns</h3><p>To arrange the fields into the layout that I want, I will need <a href="https://metabox.io/plugins/meta-box-group/">Meta Box Group</a> and <a href="https://metabox.io/plugins/meta-box-columns/">Meta Box Columns</a> extensions. Meta Box Group can help me group the fields, and Meta Box Columns helps me to divide columns.</p><p>The rule of dividing columns is: a horizontal line will be divided into 12 grids. In the settings section of each field, you can set up this size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J_5kSWzCJE6Defa8.png" /></figure><p>If you set this section as 9, it means this field will be displayed in 9 grids.</p><p>Meta Box will arrange fields into a line so that their size is not more than 12 in total.</p><p><strong>Note:</strong> Group is also a field, so its size will be set up like those of the other fields. Besides, a line inside the group also is divided into 12 grids.</p><p>To make it clearer, I draw on the form as below:</p><figure><img alt="All the custom fields for the admission form display in the post editor in the backend" src="https://cdn-images-1.medium.com/max/1024/0*IsjCQYGz-lfJrcsq.png" /></figure><p>Now, my custom fields will show up in the post editor with the new look:</p><figure><img alt="all the custom fields display in the beautiful layout" src="https://cdn-images-1.medium.com/max/1024/0*BCGSQxMrSgZUI59o.png" /></figure><h3>Special Settings of Custom Fields</h3><p>I want the student to find the admission form more professional, so I added some special custom fields. They are all available features of Meta Box or its extensions like <a href="https://metabox.io/plugins/meta-box-geolocation/">Meta Box Geolocation</a>, <a href="https://metabox.io/plugins/meta-box-conditional-logic/">Meta Box Conditional Logic</a>.</p><p>Let’s go to see it!</p><h4>Settings of the Maps Field</h4><p>In the settings section of the Maps field (Open Street Maps), you need to fill in the ID of the Address field in the <strong>Address</strong> field section. This is compulsory. If you miss it, an error alert will show up.</p><figure><img alt="settings for the open street maps field" src="https://cdn-images-1.medium.com/max/1024/0*jojtWTXap6XXD6rp.png" /></figure><p>To make the Open Street Maps work, go to the <strong>Settings</strong> tab of the field group, scroll down to <strong>Custom Settings &gt; Add New</strong>, enter geo as the key, and true as the value.</p><p>Please go to the <a href="https://docs.metabox.io/extensions/meta-box-geolocation/#enable-geolocation-support-for-a-meta-box">documentation</a> for more information about this field type.</p><h4>Settings of the Building, Road, State, Country, Post Code Fields</h4><p>I set the ID of the Building, Road, State, Country, Post Code fields as building, road, state, country, and postcode respectively.</p><p>Why? Because when you have set up the Maps field like above, if students write their information in the Address field, the data of state, country and postcode will be automatically imported to the corresponding fields. This is a feature of the Meta Box Geolocation extension.</p><p>The information has just been automatically filled in, so I set the fields as <strong>Read only</strong>, and students will not have to fill in by hand and make mistakes. It is up to you. If you do not want to do like me, that’s fine.</p><h4>Settings of the Fields in the Program / Course Information Section</h4><p>The list of courses is quite long and divided into many different majors as well, so I will use <a href="https://metabox.io/plugins/meta-box-conditional-logic/">Meta Box Conditional Logic</a> to set when the fields show up. This will make the form clearer and more professional.</p><p>For example:</p><p>The <strong>Program Type</strong> field has 3 options and 3 values respectively:</p><ul><li>undergraduate_program: Undergraduate Program</li><li>postgraduate_program: Postgraduate Program</li><li>phd_program: PhD Program</li></ul><figure><img alt="options and ID of a custom fields" src="https://cdn-images-1.medium.com/max/1024/0*ZKOOugJTRROhz76l.png" /></figure><p>I will set conditions for Undergraduate Programs, Postgraduate Programs, and PhD Program fields to show up only when students choose the corresponding option in the Program Type field.</p><p>So, in the <strong>Advanced settings</strong> tab of the <strong>Undergraduate Programs</strong> field, scroll down to the <strong>Conditional logic</strong> section, choose <strong>Add Rule</strong>, and set up like this:</p><figure><img alt="settings for custom fields with a conditional logic rule" src="https://cdn-images-1.medium.com/max/1024/0*XfeALRw9fLuewjD3.png" /></figure><p>Here we have:</p><ul><li>program_type: the ID of the <strong>Program Type</strong> field</li><li>undergraduate_program: the corresponding value of the <strong>Undergraduate Program</strong> option in the <strong>Program Type</strong> field.</li></ul><p>Do likewise with the other two fields. You just need to change the values of the options in the <strong>Conditional logic</strong> section.</p><p>Besides, you can see the Postgraduate Programs have two small options, which have different majors. Thus, I also add a new field for each of the groups. At the same time, I set up the same kind of conditions for them.</p><p>Finally, you will see all my custom fields show up like this:</p><figure><img alt="see how the maps fields and conditional logic run" src="https://cdn-images-1.medium.com/max/1024/0*JS2iWg0BbGHHsdRw.gif" /></figure><h3>Step 3: Show the Admission Form to the Frontend</h3><p>Now, we need a blank page on the frontend (I named it Admission Form), and then put the form with all of the fields we have made on this page.</p><p>Besides, I got an interesting idea. This page will look like a paper of admission form with a school logo, so it does not have the website footer or header. Thus, today we will do a new way to show the form to the frontend. It will be a little different from how we used to do it (as you may see in the <a href="https://metabox.io/create-auto-updated-cheat-sheet-wordpress/">How to Create an Auto-Updated Cheat Sheet</a>).</p><p>I will use the <a href="https://metabox.io/plugins/mb-views/">MB Views</a> extension of Meta Box to add content for this admission form page.</p><p>Go to <strong>Meta Box &gt; Views &gt; Add New</strong>.</p><p>First, scroll down to the <strong>Settings</strong> section to set up for this view. Set <strong>Admission Form</strong> is the page we want in the <strong>Location</strong> section.</p><figure><img alt="Add view to build the template for the admission form page" src="https://cdn-images-1.medium.com/max/1024/0*inCgwpqbfj-HoOOk.png" /></figure><p>In the <strong>Template</strong> section, I will add some codes:</p><pre>&lt;div class=&quot;form-header&quot;&gt;<br>&lt;!--// Put logo of the university to the header --&gt;<br>    &lt;img src=&quot;http://domain.com/wp-content/uploads/2021/05/Logo-1.png&quot; style=&quot;width: 20%&quot;&gt;<br>    &lt;div class=&quot;form-header__right&quot; style=&quot;text-align: right&quot;&gt;<br>&lt;!-- // Set H1 for page on the header --&gt;<br>        &lt;h1&gt;University Admission Form&lt;/h1&gt;<br>        &lt;span&gt;Student ID: ________ &lt;i&gt;(For office use only)&lt;/i&gt;&lt;/span&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;!--// Display the field group using shortcode --&gt;<br>[mb_frontend_form id=&#39;university-admission-form&#39;]</pre><p>To get the shortcode of the field group, go to <strong>Meta Box &gt; Custom Fields</strong>, you will see it. Notice that you must enable the <a href="https://metabox.io/plugins/mb-frontend-submission/">MB Frontend Submission</a> extension of Meta Box first. This extension will automatically generate the shortcode for you.</p><figure><img alt="get the short code of the field group" src="https://cdn-images-1.medium.com/max/1024/0*r0Lxa5m2Fkao21oa.png" /></figure><p>However, at this time, the shortcode will look like this:</p><pre>[mb_frontend_form id=&#39;university-admission-form&#39; post_fields=&#39;title,content&#39;]</pre><p>I deleted the attribute post_fields=&#39;title,content&#39; because I don’t want to show the Title and Content fields. To get to know more about the attributes of this shortcode, you can have a look at <a href="https://docs.metabox.io/extensions/mb-frontend-submission/">this documentation</a>.</p><p>Now, let’s see how the field looks on the admission form page:</p><figure><img alt="get the short code of the field group" src="https://cdn-images-1.medium.com/max/1024/0*e9wBo1tp7K92gwLu.png" /></figure><p>I think the display is not really stunning. I also want to hide both the default header and footer of the website. So, I will style it a little bit. But now, I add CSS codes into the <strong>CSS</strong> tab of the View that I have created for the Admission Form page.</p><pre>body {<br>    background: #e6e6e6;<br>}<br>.page-template-wide .container {<br>    padding: 20px 12px;<br>    background: #fff;<br>}<br>.header, .footer {<br>    display: none;<br>}<br>.form-header {<br>    display: flex;<br>    justify-content: space-between;<br>    align-items: center;<br>    margin-bottom: 20px;<br>}<br>.form-header h1 {<br>    text-align: right;<br>}<br>.rwmb-heading-wrapper {<br>    background: #e6e6e6;<br>    text-align: center;<br>}<br>.rwmb-heading-wrapper h4 {<br>    border-bottom: none;<br>}<br>.select2-container--default .select2-selection--single {<br>    height: 42px !important;<br>}<br>.select2-container--default .select2-selection--single .select2-selection__rendered {<br>    line-height: 42px !important;<br>}<br>.rwmb-image-item.attachment.estar-image-4x6 {<br>    width: 100%;<br>}<br>.rwmb-media-list:not(:empty) {<br>    padding: 0;<br>}<br>.rwmb-input-list.rwmb-inline, .rwmb-input-list {<br>    padding: 0;<br>}<br>[type=&quot;checkbox&quot;], [type=&quot;radio&quot;] {<br>    margin-right: .25rem;<br>}<br>.rwmb-input .description {<br>    margin-bottom: 0;<br>}<br>.address-group {<br>    opacity: 0.5;<br>}<br>.address-group input {<br>    pointer-events: none;<br>}</pre><figure><img alt="style for the submission form in the frontend using CSS right in the view without touching theme file" src="https://cdn-images-1.medium.com/max/1024/0*2WMIHQJOYMpwNyLh.png" /></figure><p>And this is my admission form page getting done. But, it’s not the end here!</p><figure><img alt="the admission form page of the university in the final look" src="https://cdn-images-1.medium.com/max/1024/0*X7ZOWLq03BWonb4Y.png" /></figure><h3>Step 4: Set a Page for Reviewing Admission Form</h3><p>I want to add something more to my admission form. Instead of saying thank you or notifying students for successful submissions, I expect they can review what they have written in the forms. For example, they can check student IDs (automatically shown and filled in the form), or even print the admission form pages out to save them or hand them in (if any).</p><p>Create a new page again, called <strong>Review Admission Form</strong>. After students fill their information in the forms, they will be redirected to this page.</p><p>To make the redirect link, I need to add some codes to the functions.php file of the theme:</p><pre>add_filter( &#39;rwmb_frontend_redirect&#39;, function( $redirect, $config ) {<br>    if ( &#39;university-admission-form&#39; !== $config[&#39;id&#39;] ) {<br>        return $redirect;<br>    }<br>    $redirect = &#39;https://domain.com/review-admission-form/?student_id=&#39; . $config[&#39;post_id&#39;];<br>    return $redirect;<br>}, 10, 2 );</pre><p>Here we have:</p><ul><li>&#39;rwmb_frontend_redirect&#39;: this hook allows you to change the URL of the page after students submit the form to another page;</li><li>university-admission-form: the ID of the field group for the admission form we are using;</li><li>https://domain.com/review-admission-form/?student_id=&#39; . $config[&#39;post_id&#39;]: the structure of the redirect link we will use;</li></ul><p>At that time, my redirect link will be in this form:</p><p><a href="https://domain.com/review-admission-form/?student_id=12345/"><em>https://domain.com/review-admission-form/?</em><strong><em>student_id=12345</em></strong><em>/</em></a></p><p>For example, <strong><em>12345</em></strong> is the ID of the post that the student has just entered information into its custom fields.</p><p>Next, still in the functions.php file, I will add these codes:</p><pre>function estar_get_method_function( $param ) {<br>    return isset( $_GET[$param] ) ? $_GET[$param] : &#39;&#39;;<br>}</pre><p>This code will get and return the value of the student_id variable from the redirect link. We will need this value right in the next move.</p><figure><img alt="add code to the theme file to have redirect link to the review page" src="https://cdn-images-1.medium.com/max/1024/0*qvtsuZ8PAghyi28f.png" /></figure><p>Then, create a new view in the <strong>Views</strong> section again. This view will be used for the new page that I will redirect to, the <strong>Review Admission Form</strong> page. It has the same content and style as the Admission Form page, so its view is the same as well, including template, settings, and CSS. The difference is the Location, which will be the Review Admission Form page at the moment.</p><p>In the <strong>Template</strong> section of this view, I’ll make a small change:</p><pre>{% set pupil_id = mb.estar_get_method_function( &#39;student_id&#39; ) %}<br>{% if pupil_id %}<br>    &lt;div class=&quot;form-header&quot;&gt;<br>        &lt;img src=&quot;http://domain.com/wp-content/uploads/2021/05/Logo-1.png&quot; style=&quot;width: 20%&quot;&gt;<br>        &lt;div class=&quot;form-header__right&quot; style=&quot;text-align: right&quot;&gt;<br>            &lt;h1&gt;University Admission Form&lt;/h1&gt;<br>&lt;!--        // Auto-generate the student ID --&gt;<br>            &lt;span&gt;Student ID: {{ pupil_id }}&lt;/span&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;!--// Display the custom fields along with values in the corresponding post by post ID --&gt;<br>    [mb_frontend_form id=&#39;university-admission-form&#39; post_id=&quot;{{pupil_id}}&quot;]<br>&lt;!--// Add the Print button into the footer --&gt;<br>    &lt;div class=&quot;form-footer&quot;&gt;<br>        &lt;button onclick=&quot;window.print()&quot; class=&quot;rwmb-button&quot;&gt;Print&lt;/button&gt;<br>    &lt;/div&gt;<br>{% endif %}</pre><figure><img alt="create another view with the same layout for the review page" src="https://cdn-images-1.medium.com/max/1024/0*FmZVbejHObm2oVW8.png" /></figure><p><strong>Explanation:</strong></p><p>As I have mentioned before, each admission form will be saved in a post of the <strong>Student Info</strong> post type. Thus, I have added the post_id attribute to the shortcode above, so that only the data from the custom fields of the corresponding post can show up.</p><p>Besides, I also created one more variable, pupil_id. This variable will recognize its value automatically thanks to the return value of the estar_get_method_function( &#39;student_id&#39; ) function.</p><p>Additionally, the review page has a <strong>Print</strong> button instead of <strong>Submit</strong>, so that students can print their admission forms out. Thus, I added that button to the footer of the page, and add this CSS to hide the Submit button:</p><pre>.rwmb-form-submit {<br>    display: none;<br>}</pre><p>Try a test, after submitting information, the link is changed and the Student ID is generated as well:</p><figure><img alt="the redirect link run and redirect to the review page" src="https://cdn-images-1.medium.com/max/1024/0*0MOvxxfOmrvaIfZD.png" /></figure><p>Finally, this is my whole review page.</p><figure><img alt="the review admission form page for student to review or print in the final look" src="https://cdn-images-1.medium.com/max/1024/0*wLdRVt6iVhMTAPIR.png" /></figure><h3>Last Words</h3><p>I have finished my tutorial about how to create an admission form for school or university websites. What do you think? If you find some parts difficult to understand, please feel free to leave some comments for us.</p><p>More than that, I hope that this tutorial can be helpful for many people to make various kinds of admission forms like health declarations, hospital profiles, staff profiles, etc. It seems that a lot of industries will need to digitize their information and documents. Good luck to you guys!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/create-online-admission-form-for-school-university/">Meta Box</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3794f19d7a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-create-online-admission-form-for-school-or-university-b3794f19d7a3">How to Create Online Admission Form for School or University</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Online Reservation Form for Restaurants using Meta Box]]></title>
            <link>https://medium.com/meta-box/how-to-create-online-reservation-form-for-restaurants-using-meta-box-af284eedad6e?source=rss----168d1c9db6bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/af284eedad6e</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[you-tube-video]]></category>
            <category><![CDATA[meta-box]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Janessa Tran]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 03:15:33 GMT</pubDate>
            <atom:updated>2021-07-16T03:15:33.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="How to Create Online Reservation Form for Restaurants using Meta Box" src="https://cdn-images-1.medium.com/max/1024/0*RQInmVnVMsT42XdT.jpg" /></figure><p>It is now so popular that restaurants <strong>allow customers to make online reservation from their website</strong>. So, today, I am going to have a tutorial on how to create an online submission form for that. However, it allows customers to not only provide their information but also <strong>choose a set of food or private room</strong> in advance if they want to. Furthermore, even the total amount will be figured out in the form as well.</p><figure><img alt="An online reservation form allows customers to make reservations from website of the restaurants" src="https://cdn-images-1.medium.com/max/1024/0*-EpN5a0bbjGO8fFq.png" /></figure><p>But, please note that we do not process the payment in this tutorial. Just show the number to let your customer know the amount they will be charged.</p><h3>Before Getting Started</h3><p>Along with the Meta Box core plugin from <a href="https://wordpress.org/plugins/meta-box/">wordpress.org</a>, what will we need? It’ll be these extensions or just Meta Box AIO from the Developer Bundle or the Lifetime Bundle. They are all available there, in the Meta Box AIO.</p><ul><li><a href="https://metabox.io/plugins/custom-post-type/">MB Custom Post Types &amp; Custom Taxonomies</a>;</li><li><a href="https://metabox.io/plugins/meta-box-builder/">Meta Box Builder</a>;</li><li><a href="https://metabox.io/plugins/mb-frontend-submission/">MB Frontend Submission</a>;</li><li><a href="https://metabox.io/plugins/meta-box-columns/">Meta Box Columns</a> (optional);</li><li><a href="https://metabox.io/plugins/mb-admin-columns/">MB Admin Columns</a> (optional).</li></ul><h3>Video Version</h3><p><a href="https://youtu.be/K6YfrQ3ZRLY">https://youtu.be/K6YfrQ3ZRLY</a></p><h3>Step 1: Create a New Custom Post Type</h3><p>Each reservation will be a post in this new post type. So, go to <strong>Meta Box &gt; Post Types &gt; New Post Type</strong> to create a new one.</p><figure><img alt="Create a new custom post type for the reservation" src="https://cdn-images-1.medium.com/max/1024/0*2GOgnDr7kh0yv90a.png" /></figure><p>We’ve had a video tutorial for post type configuring, please take a look.</p><p><a href="https://youtu.be/-oYrHGOri4w">https://youtu.be/-oYrHGOri4w</a></p><h3>Step 2: Create Custom Fields for the Reservation Form</h3><p>A reservation form usually includes general fields such as name, phone number, email, number of adults and children, date and time, table or room. However, as I said above, my form will have a field for choosing a set of food and show the amount.</p><figure><img alt="Create custom fields for the reservation form" src="https://cdn-images-1.medium.com/max/1024/0*Pw7OeANCt9FOXzWY.png" /></figure><p>There are some special and specific settings we should clarify here.</p><h3>ID of the Full Name Field</h3><p>I want the name of the customer to be the title of the post as well as the reservation, so I set this field’s ID as post_title.</p><h3>The Options in the Set Lunch and Private Room Fields</h3><p>These two fields are Select type, so they have the <strong>Choices</strong> section for entering the options.</p><figure><img alt="set options with the values for custom fields of choosing a food set" src="https://cdn-images-1.medium.com/max/1024/0*UWDCKl-tZ98NHash.png" /></figure><p>You can see that on the left of the colon (:), I have the numbers. They are the price (USD) of the food set with the corresponding name on the right of the colon.</p><p>The same with the <strong>Private Room</strong> field. The price is on the left, and the name of the room is on the right.</p><figure><img alt="set options with the values for the custom fields of choosing a private room" src="https://cdn-images-1.medium.com/max/1024/0*u2m2IzdT4d3hfWEN.png" /></figure><h3>Display Custom Fields as Columns in the Admin Screen</h3><p>For management purposes, restaurant owners usually want to see all the reservation information right from the admin screen. Thus, I will display the custom fields of the form as the columns in the <strong>All Reservations</strong> screen.</p><p>When we’ve activated the <a href="https://metabox.io/plugins/mb-admin-columns/">MB Admin Columns</a> extension already, there is a section available in the field’s settings that is <strong>Show as an admin column</strong>. Tick it and then some others will appear for further configuration.</p><figure><img alt="you must choose a position for the admin column" src="https://cdn-images-1.medium.com/max/1024/0*DJ1WZXFHtqkr5eOI.png" /></figure><p>Please be notified that you must choose an option in the <strong>Column position</strong> to complete the setting of the admin column.</p><p>Finally, remember to choose the Reservation post type as the Location in the Settings tab of the field group.</p><figure><img alt="remember to choose the location of the field group is reservation" src="https://cdn-images-1.medium.com/max/1024/0*gju_OM1s25Hik2-3.png" /></figure><p>So now, go to the Reservations menu, you will see the columns as follow:</p><figure><img alt="the custom fields display as the admin columns to show information of the reservations for the restaurant owners" src="https://cdn-images-1.medium.com/max/1024/0*KgMh2C_AGsCBUQKC.png" /></figure><h3>Step 3: Create the Reservation Page</h3><p>My Reservation page will have a different look from the others on my website. So, I will create a new template for it. In the template folder of the theme, create a new file named reservation-page.php with this content:</p><pre>&lt;?php<br>/**<br>* Template Name: Reservation Page<br>*/<br>get_header();<br>if( have_posts() ) :<br>    while ( have_posts() ) :<br>        the_post();<br>        ?&gt;<br>        &lt;main id=&quot;main&quot; class=&quot;site-main&quot; role=&quot;main&quot;&gt;<br>            &lt;div class=&quot;col-left&quot;&gt;<br>                &lt;?php the_content(); ?&gt;<br>                &lt;div id=&quot;total1&quot;&gt;&lt;/div&gt;<br>            &lt;/div&gt;<br>            &lt;div class=&quot;col-right&quot;&gt;<br>                &lt;?php dynamic_sidebar( &#39;sidebar-1&#39; );?&gt;<br>            &lt;/div&gt;<br>        &lt;/main&gt;<br>        &lt;?php<br>        endwhile;<br>endif;<br>get_footer();</pre><p>In there, sidebar-1 is the ID of my pre-made sidebar.</p><figure><img alt="using iframe to add Google Maps into sidebar of the reservation page" src="https://cdn-images-1.medium.com/max/1024/0*_4kJ6J4_gRKf2YPj.png" /></figure><p>I embed an iframe of Google Maps to pin the restaurant’s address on the map as well as add other contact information about the restaurant. It may help customers easier to find the restaurant location and contact them in some special cases.</p><p>After applying this template for the reservation page, it has this look:</p><figure><img alt="the reservation page with the maps and contact info of the restaurant" src="https://cdn-images-1.medium.com/max/1024/0*bmA-v3iW9vsFwYDK.png" /></figure><h3>Add the Reservation Form to the Page</h3><p>After having the <a href="https://metabox.io/plugins/mb-frontend-submission/">MB Frontend Submission</a> extension activated, this shortcode will be auto-generated.</p><figure><img alt="MB Frontend submission extension generates the shortcode for the field group" src="https://cdn-images-1.medium.com/max/1024/0*qXfXqZTuAcDiJQoJ.png" /></figure><p>It normally is in form of this:</p><pre>[mb_frontend_form id=&#39;reservation&#39; post_fields=&#39;title,content&#39;]</pre><p>I will remove the attribute post_fields to not display the <strong>Title</strong> and <strong>Content</strong> fields, and as the submit_button attribute as well. Then, paste this code to the content of the reservation page.</p><figure><img alt="paste the shortcode of the field group to the content of the page to show the field to the reservation page" src="https://cdn-images-1.medium.com/max/1024/0*Zb4GmjyvAA1ewe7-.png" /></figure><p>Now, here is the page with the form.</p><figure><img alt="the reservation form display on the frontend" src="https://cdn-images-1.medium.com/max/1024/0*DV-qgl9j1g4DWJKE.png" /></figure><h3>Prettify the Reservation Page</h3><p>It’s a kind of a rough-hewn gem and needs some polish. So, try some CSS.</p><pre>#reservation {<br>  width: 100%; }</pre><pre>.page-template-reservation-page .site-main {<br>  width: 100%;<br>  display: grid; }</pre><pre>.no-sidebar .main {<br>  margin: 0; }</pre><pre>.rwmb-label, .rwmb-input {<br>  width: 100% !important;<br>  padding-bottom: 10px; }</pre><pre>.rwmb-input input {<br>  width: 100%; }</pre><pre>.rwmb-input select {<br>  width: 100%; }</pre><pre>.page-template-reservation-page .site-main {<br>  width: 100%;<br>  display: grid; }</pre><pre>@media all and (min-width: 768px) {<br>  .page-template-reservation-page .site-main {<br>    grid-template-columns: 1fr 30%;<br>    grid-gap: 30px; } }</pre><pre>.eci-info {<br>  font-size: 16px; }<br>  .eci-info svg {<br>    width: 20px !important;<br>    min-width: 20px !important;<br>    max-width: 20px !important;<br>    height: 20px !important; }</pre><pre>.rwmb-input-group-text {<br>  border: 0 !important; }</pre><pre>.rwmb-button {<br>  padding: 10px 25px;<br>  background: #ea0808;<br>  text-transform: uppercase; }</pre><pre>.calendar .rwmb-input, .adults .rwmb-input, .children .rwmb-input, .full-name .rwmb-input, .email .rwmb-input, .phone .rwmb-input, .book .rwmb-input, .black-tie .rwmb-input {<br>  position: relative;<br>  padding-bottom: 0; }<br>  .calendar .rwmb-input input, .calendar .rwmb-input select, .adults .rwmb-input input, .adults .rwmb-input select, .children .rwmb-input input, .children .rwmb-input select, .full-name .rwmb-input input, .full-name .rwmb-input select, .email .rwmb-input input, .email .rwmb-input select, .phone .rwmb-input input, .phone .rwmb-input select, .book .rwmb-input input, .book .rwmb-input select, .black-tie .rwmb-input input, .black-tie .rwmb-input select {<br>    padding-left: 40px; }<br>  .calendar .rwmb-input::before, .adults .rwmb-input::before, .children .rwmb-input::before, .full-name .rwmb-input::before, .email .rwmb-input::before, .phone .rwmb-input::before, .book .rwmb-input::before, .black-tie .rwmb-input::before {<br>    font-family: FontAwesome;<br>    font-style: normal;<br>    font-weight: normal;<br>    text-decoration: inherit;<br>    color: #000;<br>    font-size: 18px;<br>    padding-right: 0.5em;<br>    position: absolute;<br>    top: 0px;<br>    bottom: 0;<br>    left: 0;<br>    background: #f0f0f0;<br>    display: flex;<br>    align-items: center;<br>    justify-content: center;<br>    padding: 0 8px; }</pre><pre>.calendar .rwmb-input::before {<br>  content: &quot;\f073&quot;; }</pre><pre>.adults .rwmb-input::before, .children .rwmb-input::before, .full-name .rwmb-input::before {<br>  content: &quot;\f007&quot;; }</pre><pre>.email .rwmb-input::before {<br>  content: &quot;\f003&quot;; }</pre><pre>.phone .rwmb-input::before {<br>  content: &quot;\f095&quot;; }</pre><pre>.book .rwmb-input::before {<br>  content: &quot;\f02d&quot;; }</pre><pre>.black-tie .rwmb-input::before {<br>  content: &quot;\f27e&quot;; }</pre><pre>.col-left, .col-right {<br>  background: #efefef; }</pre><pre>.col-left {<br>  padding: 10px; }</pre><pre>.col-right .eci {<br>  padding: 10px;<br>  margin-top: 0;<br>}</pre><p>In there, reservation-page is the name of the template file. And, for styling the fields, I set classes for those fields in their advanced settings and use those classes in this code such as calendar, adults, phone, book, etc.</p><p>I’m using FontAwesome here, so I must enqueue it in the functions.php file. If you add the above CSS to the style.css file as I did, you also need to enqueue it as well.</p><pre>function child_theme_scripts() {<br>    wp_enqueue_style(&#39;font-awesome&#39;, &#39;https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css&#39;, &#39;&#39;, &#39;4.7.0&#39;);<br>    wp_enqueue_style(&#39;estar-child-style&#39;, get_stylesheet_directory_uri() . &#39;/style.css&#39;, false, &#39;1.0&#39;, &#39;all&#39;);<br>}<br>add_action( &#39;wp_enqueue_scripts&#39;, &#39;child_theme_scripts&#39; );</pre><p>And now, the page turns to this look:</p><figure><img alt="the reservation page after styling by CSS" src="https://cdn-images-1.medium.com/max/1024/0*iV-Ndu_abxJfKksO.png" /></figure><h3>Step 4: Add Functions to Figure Out the Amount</h3><p>The Amount field is $0 so far no matter what you change the information in the fields many times. To figure out the amount then apply the number into this field, we must use code.</p><h3>Create a Formula for the Amount</h3><p>In the functions.php file, I’m adding this code:</p><pre>add_action( &#39;wp_ajax_total&#39;, &#39;text_domain_load_total_ajax&#39; );<br>add_action( &#39;wp_ajax_nopriv_total&#39;, &#39;text_domain_load_total_ajax&#39; );<br>function text_domain_load_total_ajax() {<br>    $adults = $_POST[&#39;adults&#39;] ?? 1;<br>    $children = $_POST[&#39;children&#39;] ?? 0;<br>    $set_lunch = $_POST[&#39;set_lunch&#39;] ?? 0;<br>    $private_room = $_POST[&#39;private_room&#39;] ?? 0;<br>    $total = ( $adults * $set_lunch ) + ( $children * $set_lunch /2 ) + $private_room;<br>    $total = &#39;$&#39; . number_format($total, 2, &#39;.&#39;, &#39;,&#39;);<br>    wp_send_json_success( $total );<br>    die();<br>}</pre><p><strong>Explanation:</strong></p><ul><li>add_action (): is a hook to create an action named total;</li><li>text_domain_load_total_ajax(): is the function to load the values of all the variables and then put them into the formula;</li><li>$adults, $children, $set_lunch, $private_room: are the variables;</li><li>$adults = $_POST[&#39;adults&#39;] ?? 1: is to check if the adults variable has any value. If it has, the value will be admitted. Otherwise, this variable will be applied to the default value, in this case, it is 1. You can set the default value as you want;</li><li>wp_send_json_success( $total ): is to return the value of the total variable in json.</li></ul><h3>Load the Values of the Variables</h3><p>So far, no value has passed to any variable yet. All the variables are 0 or 1 as default value as I set in the above code.</p><p>Whenever customers change the option in the fields, the value of the options must be recognized and passed to those variables. To load those values, I need to create a script.js file in the js folder of the theme as follow:</p><pre>(function($){<br>    $(document).ready(function(){<br>        $(&quot;#adults, #children, #set_lunch, #private_room&quot;).on( &#39;change&#39;, function(){<br>            var adults = $(&#39;#adults&#39;).val();<br>            var children = $(&#39;#children&#39;).val();<br>            var set_lunch = $(&#39;#set_lunch&#39;).val();<br>            var private_room = $(&#39;#private_room&#39;).val();<br>            console.log( set_lunch );<br>            $.ajax( {<br>                type: &quot;post&quot;,<br>                dataType: &quot;json&quot;,<br>                url : ReservationParams.ajaxURL,<br>                data: {<br>                    action: &#39;total&#39;,<br>                    adults: adults,<br>                    children: children,<br>                    set_lunch: set_lunch,<br>                    private_room: private_room<br>                },<br>                success: function(response) {<br>                    //console.log(response);<br>                    $(&#39;#amount&#39;).val(response.data);<br>                },<br>                error: function( jqXHR, textStatus, errorThrown ){<br>                    console.log( &#39;The following error occured: &#39; + textStatus, errorThrown );<br>                }<br>            } )<br>        } )<br>    })<br>})(jQuery)</pre><figure><img alt="create a JS file to load the value and send it to the function" src="https://cdn-images-1.medium.com/max/1024/0*coSzgkCzHdJC8n9O.png" /></figure><p>You can see that I used ajax here to load the values. In there:</p><ul><li>#adults, #children, #set_lunch, #private_room: are the IDs of the custom fields in the reservation form;</li><li>adults, children, set_lunch, private_room: are the variables using for the above formula, I’m assigning the values of the fields with the corresponding IDs to them;</li><li>action: &#39;total&#39;: The values are being sent by ajax to this action with the url is url : ReservationParams.ajaxURL;</li><li>success: function(response): if the request succeeds, this will call the value returned by the functions file then print to the custom field which has the ID as amount.</li></ul><h3>Enqueue the JS file and URL of AJAX</h3><p>The formula hasn’t been run yet because we haven’t enqueued either the script.js file and the url of ajax. So now, add this code to the functions.php, inside the child_theme_scripts() function we have added before.</p><pre>wp_enqueue_script( &#39;theme-script&#39;, get_stylesheet_directory_uri() . &#39;/js/script.js&#39;, array( &#39;jquery&#39; ), &#39;1.0&#39;, true );<br>wp_localize_script( &#39;theme-script&#39;, &#39;ReservationParams&#39;, array( &#39;ajaxURL&#39; =&gt; admin_url(https://medium.com/&#39;admin-ajax.php&#39;) ) );</pre><figure><img alt="enqueue the JS file and URL of the AJAX in the functions file to enable them" src="https://cdn-images-1.medium.com/max/1024/0*XV8VdYc-c1hVnDZz.png" /></figure><p><strong>Note:</strong></p><ul><li>&#39;theme-script&#39;: this name is the one you created, please pay attention that you must set it be the same in both lines;</li><li>&#39;ReservationParams&#39; and &#39;ajaxURL&#39; are from url : ReservationParams&#39;.ajaxURL, you can change them, but do it at both.</li></ul><p>Finally, everything is done. Let’s have a test.</p><figure><img alt="check the reservation form operation and see it run well" src="https://cdn-images-1.medium.com/max/1024/0*Hcakcb2k5g6OE-uf.gif" /></figure><p>You also can see that my first reservation is in posts management as well.</p><figure><img alt="my test reservation show up in the admin screen will full information" src="https://cdn-images-1.medium.com/max/1024/0*R8sdXU6eKUwVPIxF.png" /></figure><h3>Last Words</h3><p>In fact, I have met just some cases that allow customers to order the food set and let them know the total amount in advance. I’m not sure that it is popular out there. However, it still is a good reference of operations in a submission form. I guess that you should have some variations when applying this tutorial, good luck!</p><p>— — —</p><p>The publication at <a href="https://metabox.io/create-online-reservation-form-for-restaurants/">Meta Box</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af284eedad6e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meta-box/how-to-create-online-reservation-form-for-restaurants-using-meta-box-af284eedad6e">How to Create Online Reservation Form for Restaurants using Meta Box</a> was originally published in <a href="https://medium.com/meta-box">Meta Box</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>