The theme come with custom hook to add custom stack and theme option. So, you don’t need to hack into the core. Just put the code to functions.php.
<?php // add custom stack to "Stack Builder" add_filter('nt_custom_stack', 'custom_stack'); function custom_stack($stacks) { $stacks[] = array( 'id' => 'sample', 'type' => 'stack_template', 'title' => 'Sample', 'options' => array( array( 'type' => 'text', 'id' => 'stack_title', 'title' => 'Title', 'description' => '', 'default' => '' ), array( 'type' => 'text', 'id' => 'sample_text', 'title' => 'Text Input', 'description' => '', 'default' => '' ) ) ); return $stacks; } ?> <?php // Add stack presentation view // add_filter('nt_custom_stack_template_{stack_id}, $function); add_filter('nt_custom_stack_template_sample', 'custom_stack_template_sample'); function custom_stack_template_sample($stack) { return '[stack content here]'; } ?>
<?php // add custom stack to "Stack Builder" add_filter('nt_custom_stack', 'custom_stack'); function custom_stack($stacks) { $stacks[] = array( 'id' => 'sample', 'type' => 'stack_template', 'title' => 'Sample', 'options' => array( array( 'type' => 'text', 'id' => 'stack_title', 'title' => 'Title', 'description' => '', 'default' => '' ), array( 'type' => 'text', 'id' => 'sample_text', 'title' => 'Text Input', 'description' => '', 'default' => '' ) ) ); return $stacks; } ?>
<?php // Add stack presentation view // add_filter('nt_custom_stack_template_{stack_id}, $function); add_filter('nt_custom_stack_template_sample', 'custom_stack_template_sample'); function custom_stack_template_sample($stack) { return '[stack content here]'; } ?>
<?php // Custom Options add_filter('nt_custom_option', 'custom_option'); function custom_option($options) { $options[] = array( 'title' => 'Group #1', 'options' => array( array( 'type' => 'text', 'id' => 'sample_text', 'title' => 'Text Input', 'description' => '', 'default' => '' ) ) ); $options[] = array( 'title' => 'Group #2', 'options' => array( array( 'type' => 'textarea', 'id' => 'sample_textarea', 'title' => 'Textarea Input', 'description' => '', 'default' => '' ) ) ); return $options; } ?> <?php // Get option value // theme_options($category, $id); theme_options('custom', 'sample_text'); ?>
<?php // Custom Options add_filter('nt_custom_option', 'custom_option'); function custom_option($options) { $options[] = array( 'title' => 'Group #1', 'options' => array( array( 'type' => 'text', 'id' => 'sample_text', 'title' => 'Text Input', 'description' => '', 'default' => '' ) ) ); $options[] = array( 'title' => 'Group #2', 'options' => array( array( 'type' => 'textarea', 'id' => 'sample_textarea', 'title' => 'Textarea Input', 'description' => '', 'default' => '' ) ) ); return $options; } ?>
<?php // Get option value // theme_options($category, $id); theme_options('custom', 'sample_text'); ?>