Extend | Useful instructions on how to extend your Creatus WordPress Theme https://themezly.com Home of Premium WordPress Themes and Plugins Fri, 07 Sep 2018 11:10:06 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 https://themezly.com/wp-content/uploads/2018/06/cropped-themezly-favicon-150x150.png Extend | Useful instructions on how to extend your Creatus WordPress Theme https://themezly.com 32 32 Creatus Child Theme https://themezly.com/docs/creatus-child-theme/ Wed, 15 Feb 2017 19:08:16 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=537 Creatus child theme instructions

The post Creatus Child Theme appeared first on Themezly™.

]]>

The post Creatus Child Theme appeared first on Themezly™.

]]>
Custom Theme Options https://themezly.com/docs/custom-theme-options/ Wed, 15 Feb 2017 19:12:36 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=545 Instructions on how to extend Creatus theme options

The post Custom Theme Options appeared first on Themezly™.

]]>

The post Custom Theme Options appeared first on Themezly™.

]]>
Custom Theme Presets https://themezly.com/docs/custom-theme-presets/ Wed, 15 Feb 2017 19:09:07 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=540 Instructions on how to create custom theme presets

The post Custom Theme Presets appeared first on Themezly™.

]]>

Creatus WordPress Theme comes with presets Export/import utility that will help you create custom theme presets. For your convenience we have gathered a list of theme presets that come in handy when you don't need the complete theme demo but rather just want the demo theme settings.

Creating new theme preset

To create new theme preset, adjust the theme settings the way you need them, go to theme Export/import tab, click on Export theme settings button and save the preset in child theme presets folder. Note that preset file must be .json type;

├─creatus-child/
  ├─inc/
  └──thzframework/
      └─presets/
          └──preset_name.json

Assign custom default theme preset

To assign a custom theme preset to be a default preset on theme install or reset button click add this filter in your creatus child theme functions.php;

function my_filter_default_theme_preset(){
    return 'preset_name';
}

add_filter( 'thz_filter_set_preset', 'my_filter_default_theme_preset');

Custom preset CSS file

If you are using custom theme presets you can also take advantage of custom theme preset CSS file and auto load assigned preset CSS file. To do so simple create preset_name.css file and add it in creatus-child assets CSS folder;

├─creatus-child/
  ├─assets/
  └──css/
       └─preset_name.css 

The post Custom Theme Presets appeared first on Themezly™.

]]>
Custom Widgets https://themezly.com/docs/custom-widgets/ Wed, 15 Feb 2017 19:09:07 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=541 Information on how to extend Creatus theme widgets

The post Custom Widgets appeared first on Themezly™.

]]>

The post Custom Widgets appeared first on Themezly™.

]]>
Custom Extensions https://themezly.com/docs/custom-extensions/ Mon, 26 Jun 2017 20:07:17 +0000 https://themezly.com/?post_type=docs&p=742 Instruction on how to extend Creatus extensions

The post Custom Extensions appeared first on Themezly™.

]]>

The post Custom Extensions appeared first on Themezly™.

]]>
Custom Shortcodes https://themezly.com/docs/custom-shortcodes/ Wed, 15 Feb 2017 19:09:01 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=539 Instruction on how to extend Creatus shortcodes

The post Custom Shortcodes appeared first on Themezly™.

]]>

The post Custom Shortcodes appeared first on Themezly™.

]]>
Hooks and Filters https://themezly.com/docs/hooks-and-filters/ Fri, 07 Sep 2018 11:09:10 +0000 https://themezly.com/?post_type=docs&p=2163 Hooks and filters that can help you extend Creatus WordPress Theme

The post Hooks and Filters appeared first on Themezly™.

]]>
Creatus WordPress Theme Hooks and Filters

Creatus WordPress Theme comes with several WordPress hooks and filters that can help you extend or change theme functionality. To use the filter or hook just copy the snippet to your creatus-child/functions.php file and hit save.

Change logo html tag

// logoid | logo = default header logo |  logomobile =  mobile menu logo
function my_filter_textual_logo_data( $data ){

    $h_tag = is_front_page() && 'logo' == $data['logoid'] ? 'h1' :'div';

    $data['tag'] = $h_tag;

    return $data;
}

add_filter( 'thz_filter_textual_logo_data', 'my_filter_textual_logo_data' );

Change Image logo alt tags

function my_filter_image_logo_alt() {
    return 'My logo alt';
}
add_filter( 'thz_filter_logo_alt', 'my_filter_image_logo_alt' );
function my_filter_mini_header_image_logo_alt() {
    return 'My mini logo alt';
}
add_filter( 'thz_filter_mini_logo_alt', 'my_filter_mini_header_image_logo_alt' );

Add standard font to typography option font list

function my_filter_standard_fonts() {
    return array('Verdana, Geneva, sans-serif' =>'Verdana, Geneva, sans-serif');
}
add_filter( 'thz_typography_standard_fonts', 'my_filter_standard_fonts' );

Change widget list class

function my_filter_list_class_name(){
    return 'my-awesome-lists-class-name';
}

add_filter( 'thz_filter_list_class', 'my_filter_list_class_name');

Add more colors to theme colors palette

You must use color_ prefix for the colors to be recongnized.

function my_filter_add_palette_colors( $palette ){
    $palette['color_11']='#ff6600';
    return $palette;
}
add_filter('thz_filter_palette_colors', 'my_filter_add_palette_colors' );

Include files action

The do_action( 'thz_filter_init_includes' ); fires before any Creatus files inclusion. This way you can add own files on init.

function my_filter_init_include_files (){

    require_once get_stylesheet_directory_uri(). '/inc/my-awesome-class.php';
}

add_action('thz_filter_init_includes','my_filter_init_include_files');

Add own local host to combine shortcodes CSS files

If you are working on your localhost, during changes of any builder elements CSS files there is a function that runs only if files have been changed and it is combining all elements CSS in to the thz-shortcodes.css file. This is the default local hosts list.

$locals = array(
    'localhost', 
    '127.0.0.1', 
    '192.168',
    '.test', 
    '.example', 
    '.invalid', 
);

If the function does not run for you or you need to add a new local to the list use this filter

function my_filter_add_local_host ( $local_hosts ){
    $local_hosts[]='my_local_host';
    return $local_hosts;
}

add_filter('thz_filter_combine_shortcodes_local_hosts', 'my_filter_add_local_host' );

Enable Gutenberg ( block ) editor

By default Creatus disables Gutenberg editor and let you use the Tinymce editor for all posts types and pages. To modify this filter or enable Gutenberg on specific post type you can re-declare the filter function in your child theme functions.php file.

/*
 * Disable block editor
 * in case you need some logic see:
 * https://gist.github.com/danyj/ec00057550fd6f73995ab2f8fc8b729f
 */
function _thz_filter_disable_block_editor_pt( $use_block_editor, $post_type ){

  $use_block_editor = true;
  return  $use_block_editor;

}

The post Hooks and Filters appeared first on Themezly™.

]]>
Changing Theme Admin Splash Image https://themezly.com/docs/changing-theme-admin-splash-image/ Wed, 15 Feb 2017 19:13:28 +0000 http://localhost/Creatus/Themezly/?post_type=docs&p=547 Instructions on how to change admin splash image

The post Changing Theme Admin Splash Image appeared first on Themezly™.

]]>

The post Changing Theme Admin Splash Image appeared first on Themezly™.

]]>