Even though Theme Redone is a stable solution that’s been under development and testing for more than two years, there’s still room for more improvement and other ideas. Some of the plans that we have for Theme Redone Creating a Docker-ready version of the theme Creating more useful utility...
{tr_posted_on($author_id)} Prints the author’s name. Tries to print first_name and last_name first. If they are not set, defaults to display_name. Arguments: $author_id. If we are using this function inside our custom loops. We need to pass the author’s ID. Optional, Type: INT or false, Default:...
Theme Redone is a starter theme (framework) that is meant to be used for building high-performance custom WordPress websites from the ground up. To ensure that, we are dequeuing a few default WordPress scripts and styles such as jQuery and Emojis for example. We are also overwriting some admin things to...
TRB-CLI is a handy Node.js CLI that automates the process of managing blocks in a theme-redone theme. Instead of manually creating new blocks, and copying and renaming files, you can do just that with a single simple command. To learn how to manually create a new block, read the Single Block Creation...
Renders Gutenberg’s DateTimePicker component inside the block. The type we would use inside the schema’s field_meta property to render this field is “datetime”: "type": "datetime" If you haven’t already, we suggest you read the “model.json file” and “Field...
This file is optional. Most of the time, this is where we would write JS code specific to the block. “most of the time” because some scripts might be shared and written inside other files. If used, this file will be compiled to the /prod/block-specific//frontend.min.js file that will be...
This file is very similar to the EditMain.js one. The difference, however, is that EditSidebar.js is an optional file, and EditMain.js is not. Another difference is that this file is used to render the fields in the sidebar area of the block in the admin UI, while the EditMain.js renders them in the main...
EditMain.js file is responsible for building the admin UI for the block (and its fields) based on the Schema written in the model.json file. How does this work? Let’s take a look at the code of this file /EditMain.jsimport TrDefaultFieldsHandler from...
As we’ve explained in the view.latte page (please read it before continuing), Gutenberg offers us two ways for rendering blocks. Via PHP and via JS. Our primary method and the preferred one is via PHP (latte). But, there are still use cases where we’d want to render it via JS. We would do that...
This is the file that we use to build the front end and show the data from the fields defined in model.json and then populated in the admin screen. Gutenberg has two ways of rendering blocks on the front end: via PHP and via JS. Our primary way of handling this is via PHP, or...
This is a required file. It acts sort of as a glue between the Schema and the View (Front-End). It reads the fields and their values and makes it possible to use those fields in the View file. By default, without any modification, it will look like this. /controller.php<?php $block_name =...
This file is optional. If used, this is where we would write admin SCSS code specific to the block. Theme-Redone’s Field Types are standardized and have a uniform look and feel in the back-end. Inside the editor, they would look something like this (depending on the schema defined in the model.json...
This file is optional. Most of the time, this is where we would write SCSS code specific to the block. “most of the time” because some styles might be shared and written inside other files. Also, we have support for critical CSS that you could read more about on the page about overall CSS...
Renders a Video Selector component inside the block. The type we would use inside the schema’s field_meta property to render this field is “video”: "type": "video" If you haven’t already, we suggest you read the “model.json file” and “Field Types” pages before...
Renders a toggle control inside the block. The type we would use inside the schema’s field_meta property to render this field is “toggle”: "type": "toggle" If you haven’t already, we suggest you read the “model.json file” and “Field Types” pages before...
Renders a select control inside the block. The type we would use inside the schema’s field_meta property to render this field is “select”: "type": "select" If you haven’t already, we suggest you read the “model.json file” and “Field Types” pages before...
Renders a custom TrRepeater Component inside the block The type we would use inside the schema’s field_meta property to render this field is “repeater”: "type": "repeater" If you haven’t already, we suggest you read the “model.json file” and “Field Types”...
Renders Gutenberg’s RangeControl component inside the block. This Field Type can be used for multiple purposes, some of which might be: Controlling the padding of an element, rendering numbers on the front-end but limiting what numbers an admin could use within a range, controlling transforms on...