API – Header style – Introduction

Available on: Newsmag V1.8+, Newspaper V5+
The td_api_header_style api call allows you to add a new header style and to modify or delete one of the theme existing header styles. By default the theme uses Header Style 1 which looks like this:

td_api_default_header_style

 

The header style can be changed from the Theme Panel -> Header section. If you use the theme API to add a new header style it will appear like this:

td_api_new_header_style

 

The theme existing header styles are registered in td_config.php, the code looks like this:

td_api_header_style::add('1',
    array(
        'text' => '<strong>Style 1 - </strong> default',
        'file' => td_global::$get_template_directory . '/parts/header/header-style-1.php'
    )
);

Parameters

$id (string) (required)

  • the header style id – if you add a new header style the id has to be different from the ones used on the other header styles which are registered in theme, if you plan to modify one of the existing header styles the id has to match with the one you’re planing to modify.

$params_array (array) (required)

  • an array which contains the parameters of the header style (text, file)
Key name
Type
Description
text string the title of the header style, it appears in Theme Panel -> Header -> Header Style
file string the path of the template file