Framework 33 – Add Custom Option to OPT Theme
open : “ndframwork / extras / optheme-custom-config.php”
add:
<!———————– !>
$this->sections[] = array(
‘title’ => __(‘Questions & Answers settings’, THEMENAME),
‘header’ => __(‘Questions & Answers’, THEMENAME),
‘desc’ => ‘<p class=\”description\”>’.__(“From this tab you can manage the site logo and favicon”, THEMENAME).'</p>’,
‘icon’ => ‘el-icon-cogs’,
‘icon_class’ => ‘icon-small’,
‘fields’ => array(
array(
‘id’ => $shtname.’main_question_imm’,
‘type’ => ‘media’,
‘url’=> false,
‘title’ => __(“Big Top Image”, THEMENAME),
‘subtitle’ => __(“Upload your main section image.”, THEMENAME),
),
array(
‘id’ => $shtname.’main_question_txt’,
‘type’ => ‘textarea’,
‘title’ => __(‘Text main section’,THEMENAME)
),
array(
‘id’ => $shtname.’button_question_txt’,
‘type’ => ‘text’,
‘title’ => __(‘Button Ask Questions’,THEMENAME)
),
array(
‘id’ => $shtname.’button_question_subtitle’,
‘type’ => ‘text’,
‘title’ => __(‘Subtitle Ask Questions’,THEMENAME)
),
)
);
<!———- ——>
Immediatly after ” $shtname = SHORTNAME; ”
2) – Copy, paste, and change, in “ndsToTheme.php” the following snippet.
/* =============================================================================
Show Main Banner Info
============================================================================= */
public function ndBannerCOntact(){ ?>
<div class=”row all-bspace-small”>
<div id=”bann_cont” class=”column md-8 col-xs-nospace-up txtpost”>
<p><?php echo $this->optmbtheme[$this->shortname.’banner_con_txt’]; ?></p>
</div>
<div id=”bann_cont_ph” class=”column md-8 col-xs-nospace-up phpost”>
<p><?php echo $this->optmbtheme[$this->shortname.’banner_con_ph’]; ?></p>
</div>
</div>
<?php
}
3) – Call the function created before in the theme file
add this where you need it ” <?php $ndsThemeOpt->ndBannerCOntact(); ?> “