Templates & Theme Builder
Free template tools (2)
Section titled “Free template tools (2)”emcp-tools/save-as-template
Section titled “emcp-tools/save-as-template”Saves a page (or any element) as a reusable template in Elementor’s template library.
Input:
post_id: source pageelement_id: optional, save just one element; omit for whole pagetitle: name for the new templatetype:page,section,widget
Returns: { template_id }.
emcp-tools/apply-template
Section titled “emcp-tools/apply-template”Applies a saved template to a target page. Inserts the template’s elements as children of the page root (or of a specific parent if you pass one).
Input:
target_post_idtemplate_idparent_id: optional insertion target inside the target pageposition: child index,-1to append
Returns: { inserted_element_ids: [...] }.
Pro theme builder tools (6, when Elementor Pro is active)
Section titled “Pro theme builder tools (6, when Elementor Pro is active)”emcp-tools/create-theme-template
Section titled “emcp-tools/create-theme-template”Creates a theme builder template: header, footer, single post, archive, error 404, or loop item.
Input:
titletemplate_type:header,footer,single-page,single-post,archive,error-404,loop-item
Returns: { template_id, edit_url }.
emcp-tools/set-template-conditions
Section titled “emcp-tools/set-template-conditions”Sets display conditions on a theme builder template (which pages it applies to).
Input:
template_idconditions: array of{ type, sub_type, name?, exclude }
emcp-tools/list-dynamic-tags
Section titled “emcp-tools/list-dynamic-tags”Lists every dynamic tag available from Elementor Pro (post-title, author-info, ACF fields, etc.), grouped by category.
Returns: array of { name, title, group, categories }.
emcp-tools/set-dynamic-tag
Section titled “emcp-tools/set-dynamic-tag”Binds a dynamic tag to a specific element setting. Replaces the static value with a dynamic reference that Elementor evaluates per-page.
Input:
post_idelement_idsetting_key: which setting to bind (e.g.title)dynamic_tag: the tag name fromlist-dynamic-tagssettings: tag-specific config (varies per tag)
emcp-tools/create-popup
Section titled “emcp-tools/create-popup”Creates a popup template.
Input: title.
Returns: { popup_id, edit_url }.
emcp-tools/set-popup-settings
Section titled “emcp-tools/set-popup-settings”Sets triggers, display conditions, and timing on a popup.
Input:
popup_idtriggers: array (page-load, scroll, click, exit-intent, inactivity)conditions: display conditions (same shape asset-template-conditions)timing: show frequency rules