Loops & Logic is a toolset that allows you to have extensive control over the display of WordPress content & data on your site's frontend for when your theme or builder doesn't take the options you demand. This plugin gives you the power of custom PHP theme & builder module development using a simplified HTML-like syntax that will be familiar to any frontend developer.

Support

  • Delight encounter our documentation site for a consummate description of plugin features.
  • Support & discussions can be constitute on our forum located here.

Key Features

  • Utilise HTML templates with dynamic tags like Loop, Field, and If
  • Employ theme location rules to employ custom templates to mail service types, taxonomies & more (similar to Beaver Themer or Elementor Theme Builder)
  • Hands enqueue your CSS stylesheets and Javascript anywhere using a visual location dominion builder
  • Seamlessly write your CSS directly in SASS without worrying well-nigh compilation
  • Create query loops of whatsoever content blazon, such equally: posts, pages, custom postal service types, attachments, users, taxonomies and terms
  • Display built-in and custom fields
  • Build logic to display things based on certain conditions, for example: creating a menu, with some links only for logged-in users, or past user office
  • Create custom shortcodes to display annihilation from a custom field to an entire dynamic-data driven web page

Example Usage

At the core of L&50 is the ability to quickly and elegantly loop through WordPress data like in this example of displaying a listing of links to the three virtually recent posts

                  <ul>   <Loop type=postal service count=three orderby=date order=desc>     <li>       <a href="{Field url}"><Field championship /></a>     </li>   </Loop> </ul>                                  

Accomplishing the same thing in PHP is a fiddling more than complex:

                  <?php $args = array(     'post_type' => 'post',     'posts_per_page' => 3,     'orderby' => 'date',     'society' => 'DESC', ); $query = new WP_Query( '$args' ); ?> <?php if ( $query->have_posts() ) : ?>   <ul>     <?php while ( $query->have_posts() ) : $query->the_post(); ?>        <li>         <a href="<?php the_permalink(); ?>">           <?php the_title(); ?>         </a>       </li>      <?php endwhile; ?>   </ul> <?php endif; ?>                                  

It can be difficult to add PHP to your site if you're non a backend programmer, but 50&50 is a breeze to include, even in a folio architect layout.

Page builders like Gutenberg, Elementor, and Beaver Builder often have gaps in their capabilities that would commonly crave y'all to either develop a custom improver or buy a bloated add-on pack just to get the i element you need. L&Fifty adds a template editor module directly to each builder and so that you can simply describe what you want to display in L&L code and identify it using the builder interface. Yous tin even copy-paste your 50&50 code between page builders if you piece of work with more than one! It's like having your own folio builder addon factory.

Plugin & Theme Back up

Plugin Support:

Loops & Logic works with the post types and custom fields added by well-nigh plugins, but plugins with special data structures like a custom tables or fields with data formats that demand parsing crave us to program explicit support.

Bundled integrations:

✅ Advanced Custom Fields (ACF)

L&50 supports Avant-garde Custom Fields (ACF) field types in the core, allowing you to work with nearly of their field types out of the box! We also plan to support other WordPress custom field plugins such equally Pods & Metabox in the future.

                  <Loop acf_flexible=field_name>   <If field=layout value=layout_1>      Layout 1     <img src="{Field acf_image=field_name field=url}" />     <Field acf_editor=field_name />    <Else if field=layout value=layout_2 />      Layout 2     <Field acf_editor=field_name />     <img src="{Field acf_image=field_name field=url}" />    </If> </Loop>                                  

✅ WP Fusion

The freely-included WP Fusion integration allows you to utilize conditional logic to protect or display different content based on a user's tags.

                  <If user_field=wp_fusion_tags includes value="123">   User has tag ID 123 <Else />   User does not have tag. </If>                                  

Nosotros'll be rolling out premium addons for popular plugins in the coming months, so check out our website to meet what's available!

Premium addons coming soon:

  • WooCommerce
  • Easy Digital Downloads
  • Mod Tribe Events Calendar
  • Gravity Forms
  • LearnDash
  • LifterLMS

Theme Back up:

Everything will work with themes congenital co-ordinate to WordPress standards.

This plugin provides 1 block.

  • Tangible Template
  1. Install & actuate in the admin: Plugins -> Add together New -> Upload Plugins

If you accept been using Widgets for years and years and, like me, now find that the Widget editor has gone crazy, fright not, Tangible Templates take replaced all my Widgets with a much better solution. If you have been using the plugin Custom Content Shortcode for years and years and, like me, accept just institute out that it being deprecated, fear not! I wish I had establish this Plugin sooner. Unproblematic functions like <if loop exists ...> makes building flexible folio layouts and then much easier. I am now reviewing all the shortcodes that I have created or used from other plugins to run into which can be replaced by Tangible Templates. Swell support from the team and community. I would have appreciated more examples to assistance me become started, simply now I'1000 off the ground I want to explore what else this plugin can practise.

THIS! IS! AMAZING! Beloved Information technology! <3

Loops & Logic is awesome! Makes it so easy to build out dynamic content and support has been amazing.

This has become my default plugin. I hope more and more people will share its usage. For beginners, it is best to list all tags or index tags direct in the appropriate place for quick option. If possible, I hope to add together multi site options in the future. For example, all sub sites enable the same section of CSS / JS, which does non accept to be ready in each sub site.

Equally a designer (read "person regularly mystified by lines of PHP") I found this plugin useful in achieving what I could not do with my page builder of option. I feel like I'm only scratching the surface of what this plugin can do, but am eager to learn more. I hope they add more examples to the documentation. My thanks to the programmer(s).

This plugins is a game changer. Actually easy to use. Def. continue an eye on information technology.

Read all 8 reviews

"Loops & Logic" is open source software. The post-obit people have contributed to this plugin.

Contributors

  • Tangible

2.three.ix

Release Engagement: 2022-02-28

  • Fix issue with backslash escape when saving precompiled CSS
  • URL tag: Solve issue with getting URL query

2.three.7

Release Engagement: 2022-02-23

  • Add Query variable type
    • Support multiple loops reusing aforementioned query
    • Set up default query with variable proper noun "default"
  • Add Template Category for organizing templates
    • Add admin column and filter
    • Support import and consign
  • Template archive screen: Sortable post blazon
    • Meliorate table row display while existence dragged/sorted
    • Disable drag/sort when Quick Edit panel is open

two.3.six

Release Engagement: 2022-02-xvi

  • Loop tag: Ensure previous total is correctly set to 0 if terminal loop had no items
  • Post loop: Add together alias "tag" for taxonomy "post_tag"
  • User loop: Add field "locale" for user'due south Language setting, with fallback to site locale
  • User condition: Support multiple values for If user_role includes
  • HTML module: Support passing empty cord as attribute value, singled-out from attribute without value
  • Ameliorate compatibility with PODS

2.3.5

Release Date: 2022-02-09

  • Add ACF Time field type
  • Default loop context
    • Handle instance when called too early, for case earlier action 'wp'
    • Clone WP_Query object so it's not afflicted when posts rewind at the end of loop
  • If tag: Add date conditionals (earlier/before_inclusive/after/after_inclusive) for check, field, and ACF date/engagement-time/time fields
  • If and Field tag: Add together "from_format" attribute to catechumen from non-standard appointment format
  • Improve formatting ACF Appointment and Appointment/Time fields
  • Improve template preview on folio architect initial load
  • Improve Beaver/Elementor/Gutenberg integrations
  • Postal service loop: Pass optional attribute reverse=truthful to field "ancestors"

2.iii.three

Release Date: 2022-02-08

  • Add Async tag: Asynchronously return template via AJAX
  • Add Cache tag: Cache rendered template using Transient API, which supports external object cache such as Memcached, Redis, or LiteSpeed
  • Add Random tag: Generate a random number with attributes "from" (default: 1) and "to" (default: 99)
  • Add Taxonomy and Term tags: Shortcut for current post's taxonomy/terms
  • Add User tag: Shortcut for current user'south field
  • Ensure logic rules exist for all ACF field types
  • Set alert when admin card does non include Tangible section for not-admin users
  • Loop paginator
    • Refactor and consolidate common logic with async return
    • Remove deprecated method with Paginate tag
  • Simplify Timer tag: beginning/check/stop
  • Taxonomy term loop: Add field "link" to create an anchor tag with term title
  • User loop: Optimize for getting electric current user; Add field "office" equally alias of "roles"

2.3.ii

Release Date: 2022-01-31

  • Improve PHP 8 compatibility
  • Template edit screen: Ensure postal service slug is passed to AJAX relieve
  • Add together Timer tag for profiling render fourth dimension of template sections

2.3.0

Release Engagement: 2022-01-19

  • Template location rules
    • Support include/exclude by taxonomy terms
    • Back up extensible theme positions, such as header, footer, and parts
    • Add theme integrations: Astra, Kadence
    • Beaver Builder Theme is non designed for replacing theme positions
    • Start plugin integrations: Beaver Themer, Elementor Pro
  • Template edit screen
    • Remove actress metaboxes added past WP core or other plugins/themes
    • Use AJAX salve for the publish button, except for new or draft posts which require form submit and page reload
    • Ensure universal ID is passed when saving via AJAX
  • Template script: Load afterwards content, unlike styles which are loaded before content
  • Template assets: Improve inline documentation
  • Importer: Create new universal ID for duplicates in "keep both" mode
  • Format tag: Correctly apply decimal=0 for format type "number"
  • Mail service loop: Club past custom field is college priority than normal "orderby" parameter

2.two.9

Release Date: 2021-12-22

  • Universal ID – Unique and immutable across sites
    • Implement for all template types
    • Dynamic blocks in supported builders
    • Import/export
  • Exporter: Save and restore settings from browser local storage
  • Gutenberg integration: Disable links in blocks when inside editor preview (Elementor and Beaver already does this by default)
  • Format tag: Correctly trim past length
  • Form tag: Improving default content type action "create"; Add redirect on success/error
  • Add ACF field type "Tangible Bulletin" – Based on default message field, it renders a template instead of apparently text
  • Add together build script to remove sourcemap comment from vendor libraries used for CodeMirror editor

two.2.seven

Release Engagement: 2021-xi-26

  • Loop pagination: Automatically pass variables used in inner template
  • Fix typo in importer message for "Layouts"
  • Ameliorate handling when block control config blazon is empty
  • If tag: Improve treatment when else node has no attributes property

2.ii.iv

Release Engagement: 2021-11-18

  • Location field for Layout template: Amend updating selected rule parts on initial render
  • Field tag: Add attribute "custom" to get custom field whose proper name overlaps with an alias, for example, "name"
  • Start Course module – Piece of work in progress
    • Add Form tag with local tags: BeforeSubmit, Success, Error, Mail
    • AJAX form handler
    • Grade actions with dynamic variables and templates

2.ii.3

Release Appointment: 2021-11-eleven

  • Make template assets map available every bit Sass and JS variables (See "Assets" tab for documentation)
  • Taxonomy term loop: Add together query parameter "name" as allonym of "include"
  • Meliorate user access control for Template module
  • New templates are assigned "universal ID", which is unique and immutable across sites

two.i.7

Release Appointment: 2021-11-02

  • Add Exit and Catch tag
  • Add variable types: local, sass, and js
  • Template tag and shortcode: Pass attributes to template equally local variables
  • Update CodeMirror library: Relax lint rules for Sass "belongings-sort-guild" and HTML "id-unique"
  • Improve admin bill of fare organization

2.ane.6

Release Date: 2021-10-20

  • Add carte du jour loop type
  • Calendar loop types
    • Add "year" loop
    • Add "locale" attribute to translate names
    • Add together "format" attribute for field "date"
    • Add fields: name, short_name, month_with_zero, week, weekday

2.i.5

Release Appointment: 2021-10-07

  • ACF fields: Add special subfields for getting field config, such equally labels and choices
  • Base loop: Improve handling of query argument "count"
  • Template editor: Solve Gutenberg event with keyboard shortcuts

2.one.4

Release Engagement: 2021-09-thirty

  • Template editor improvements
    • Telescopic all CSS styles under wrapper form so editor can co-exist with other instances of CodeMirror
    • Implement line wrapping feature
    • Certificate common keyboard shortcuts: https://loop.tangible.1/overview/template-editor
    • Update CodeMirror add-ons and modes

two.ane.three

Release Appointment: 2021-09-29

  • Url tag: Support attribute "query" without value
  • Improve welcome bulletin; Add link to new documentation site
  • Movement WP Fusion integration from Pro plugin

2.1.2

Release Date: 2021-09-22

  • Better escaping outputs
  • CodeMirror editor improvements: Update dependencies; Implement lawmaking folding improver; Improve shut tag addition behavior

2.1.0

Release Date: 2021-09-15

  • Importer: Ensure escape characters are preserved in template fields
  • Base of operations loop: Better field_compare=exists to recognize loop example

ii.0.7

Release Date: 2021-09-07

  • Initial release of Template Assets feature to import/export media attachments
  • Articulate compiled styles when Fashion field is empty
  • Add loop blazon "acf_group" for ACF grouping field
  • Add field "acf_key" to become field by ACF key
  • Export: Add together setting for package proper name
  • Attachment loop: Add field "mime" for MIME type

2.0.5

Release Appointment: 2021-09-05

  • Importer: Evidence links to newly created templates
  • Loop default context: Better checking if nosotros're already within current post content
  • Beaver Architect integration: Improve checking if current post is being edited in the architect
  • Add workaround to preserve escape characters in template fields

2.0.3

Release Appointment: 2021-09-01

  • Chart tag
    • Add ticks options – percentage, before text, afterward text
    • Add together tooltip values
    • Add data labels

2.0.2

Release Date: 2021-08-19

  • Improve support for nested ACF flexible content and repeater fields
  • Post Loop: Improve query by raw field value
  • Base of operations Loop: Improve filter/sort by field

2.0.0

Release Date: 2021-08-10

  • Import/export templates
  • Back up tertiary-party integrations

1.2.8

Release Appointment: 2021-07-twenty

  • Add template include filter for Layout templates
  • Ready interface for tertiary-party integrations, including Loops & Logic Pro
  • ACF "editor" field blazon (WYSIWYG): Format field value by default

1.2.seven

Release Date: 2021-07-xvi

  • Simplify logic to reliably foreclose infinite loop for default loop context and postal service content in general

ane.2.half dozen

Release Date: 2021-07-ten

  • Loop module: Improve logic to prevent infinite loop, when using default loop context (global $wp_query)
  • Gutenberg and Elementor integration: Improve handling template manner/script

1.2.3

Release Date: 2021-07-01

  • If tag: Add ACF field type conditions, such as acf_checkbox, acf_relationship, etc.
  • Taxonomy and taxonomy term loop: Better sort past custom field

i.2.i

Release Date: 2021-06-30

  • Taxonomy term loop: Add together query parameters "hide_empty", "orderby_field", "orderby_field_number"; Add field "count"
  • Template mail service types: Add "name" field (post slug) in admin edit screen and Template tag
  • Template tag: Add "theme" aspect to load theme templates: sidebar, search, and part
  • Layout mail type: Add "Theme parts" settings to load alternate header or footer
  • Loop tag: Add together logic to prevent infinite loop when a post loads itself; Amend treatment default loop context (global $wp_query) when used without "type" attribute, especially in the context of Beaver template and layout

1.two.0

Release Date: 2021-06-22

  • Add ACF field blazon "Tangible Template" (under Content section)
  • Add together template types Mode, Script, and Layout, with theme location rules builder
  • Gutenberg, Elementor, Beaver Builder: Add together ability to select from saved templates
  • Field tag: Add attributes "template" and "acf_template" to render Template field
  • If tag: Add conditions for main query: "atypical" and "annal" (category, tag, taxonomy, mail, author, and date)
  • If tag: Add together common operators "in" and "not_in" to check if value is in given list
  • Template tag: Add together attribute "type" for layout, style, script, block

1.1.8

Release Date: 2021-06-10

  • Zipper Loop: Add fields "srcset" and "sizes" for responsive prototype attributes
    • For featured image in post loop, the field names are "image_srcset" and "image_sizes"
  • Field tag: Add aspect "detail" to get an item from a list, using index starting with 1
  • Meta tag: Support "viewport" aspect

i.1.6

Release Appointment: 2021-06-02

  • Chart tag: Add options chart_title, chart_legend, axis_x, axis_y
  • HTML module: Improve treatment JSON object and assortment in tag attributes
  • Template shortcode: Support passing template as inner content

1.ane.3

Release Engagement: 2021-05-21

  • Publish to WordPress plugin directory