🔥 Black Friday: Up to 50% Off All Plans
Days
Hrs
Min
Sec

Need Help?

Here are some good places you cant start.

Whats New?

Get updated about all the good stuff!

wordpress-black-friday-deals-2025
Unlimited Elements for Elementor – Version 2.0
Unlimited Elements for Elementor – Version 2.0

Use your custom twig template

You can write your own Twig templates in PHP and then use them in any widget. This is useful when several widgets need the same piece of HTML.

Step 1

In the functions.php file of your theme, or in a code snippet, add your templates with the uelm_get_twig_templates filter. Each template has a name and Twig content:

				
					function addMyTemplates($arrMyTemplates){

	$arrMyTemplates["mytemplate"] = "<div class=\"my-box\">{{title}}</div>";

	return($arrMyTemplates);
}

add_filter("uelm_get_twig_templates", "addMyTemplates");
				
			

The older filter name ue_get_twig_templates still works too.

Step 2

In the HTML of your widget, show the template with ucfunc(“render”) and the template name:

				
					{{ ucfunc("render", "mytemplate") }}
				
			

The template gets the same data as the widget, so you can use all the attributes of the widget in it. When you use it in the Item HTML, it gets the data of the current item.

Hurray!

You got FREE access to the worlds leading widgets for Elementor page builder!

Download is just a click away

Get instant access to tons of Elementor goodies, completely FREE!