{"id":7891,"date":"2022-06-15T00:37:06","date_gmt":"2022-06-15T00:37:06","guid":{"rendered":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/?p=7891"},"modified":"2022-06-20T17:55:50","modified_gmt":"2022-06-20T17:55:50","slug":"conditional-rendering","status":"publish","type":"post","link":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/2022\/06\/15\/conditional-rendering\/","title":{"rendered":"Conditional Rendering"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">With this feature, you can set display conditions of section according to your requirements. There are 3 available display conditions such as &#8220;Device Type&#8221;, &#8220;Login Status&#8221;, &#8220;User Role&#8221; and you can determine whether the section should be or not on a page by using one multiple conditions of them.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Device Type<\/strong>: You can show or hide section on mobile for better optimization on mobile devices.<\/li><li><strong>Login Status<\/strong>: Logged user and Guest can get different looks on same page.<\/li><li><strong>User Role<\/strong>: Some sections should be only displayed to authorized users.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"826\" height=\"696\" src=\"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-content\/uploads\/sites\/17\/2022\/06\/condition.png\" alt=\"\" class=\"wp-image-7978\" srcset=\"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-content\/uploads\/sites\/17\/2022\/06\/condition.png 826w, https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-content\/uploads\/sites\/17\/2022\/06\/condition-768x647.png 768w\" sizes=\"(max-width: 826px) 100vw, 826px\" \/><figcaption>Condition Rendering<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Maybe you have a question about using this addon will increase dom size. But you don&#8217;t have to worry about that point.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because this addon renders each content in each condition, so dom size is not increased.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With this feature, you can set display conditions of section according to your requirements. There are 3 available display conditions such as &#8220;Device Type&#8221;, &#8220;Login Status&#8221;, &#8220;User Role&#8221; and you can determine whether the section should be or not on a page by using one multiple conditions of them. Device Type: You can show or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[39],"tags":[],"class_list":["post-7891","post","type-post","status-publish","format-standard","hentry","category-udesign-element-addons"],"_links":{"self":[{"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/posts\/7891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/comments?post=7891"}],"version-history":[{"count":1,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/posts\/7891\/revisions"}],"predecessor-version":[{"id":7990,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/posts\/7891\/revisions\/7990"}],"wp:attachment":[{"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/media?parent=7891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/categories?post=7891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/d-themes.com\/wordpress\/udesign\/documentation\/wp-json\/wp\/v2\/tags?post=7891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}