Available on: Newsmag V1.8+, Newspaper V5+
This api call is used to update only one of the parameters of an existing single template.


<?php td_api_single_template::update_key( $id, $key, $value ) ?>


$id (string) (required)

  • the single template id – has to match with one of the single templates which are already registered in the theme

$key (string) (required)

  • parameter to be replaced, in the following table you can see all parameters but only one can be used because via this method you can update only one parameter:
Key name
file string the path of the single template file
text string the name of the single template style
img string the single template style icon, appears near the style name on post editing section
show_featured_image_on_all_pages boolean force featured image display on all pages
bg_disable_background boolean disable the featured image
bg_box_layout_config string auto | td-boxed-layout | td-full-layout
bg_use_featured_image_as_background boolean uses the featured image as a background

$value (mixed) (required)

  • the data which will replace the parameter existing one, it’s type depends on the selected parameter.


In the following example we’ll update the existing Single Template 1 ,  the ‘file’ key data will be replaced, you can see how the code looks on plugin, you have to modify the file path to match with the plugin current folder, we use the variables which were introduced in the Plugin Method section, ex:

td_api_single_template::update_key('single_template_1', 'file', $this->plugin_path . '/single_template_1.php');