Modifying Admin Theme Options

Moderator: forum_m

Post Reply
dewright1975
Posts: 8
Joined: August 26th, 2015, 1:28 am

Modifying Admin Theme Options

Post by dewright1975 » December 13th, 2016, 1:16 am

I would like to modify the contact options in the admin panel. I would like to add Detail Information Sub. Can you let me know what files I would need to modify to add additional info lines in the admin panel.

So far I have found that I would need to modify default-options and option-settings. I have added the following code:

default-options:

// contact options
'contact_detail_heading' => __('Contact Us','weblizar'),
'contact_icon_1' => 'fa fa-map-marker',
'contact_icon_2' => 'fa fa-phone',
'contact_icon_3' => 'fa fa-map-marker',
'contact_icon_4' => 'fa fa-envelope',
'contact_heading_1' => __('Address','weblizar'),
'contact_heading_2' => __('Phone','weblizar'),
'contact_heading_3' => __('Headquarter','weblizar'),
'contact_heading_4' => __('Email','weblizar'),
'contact_detail_1' => __('Honey Buiseness Twenty Fourth St, Los Angeles, USA','weblizar'),
'contact_detail_sub_1' => __('Sub Details 1','weblizar'),
'contact_detail_2' => __('+91 9876543210, 1234567890','weblizar'),
'contact_detail_sub_2' => __('Sub Details 2','weblizar'),
'contact_detail_3' => __('Joney Buiseness Twenty Fourth Angeles, 1 USA, Earth, Milkyway Galaxy.','weblizar'),
'contact_detail_sub_3' => __('Sub Details 3','weblizar'),
'contact_detail_4' => __('weblizar@gmail.com','weblizar'),
'contact_detail_sub_4' => __('Sub Details 4','weblizar'),
'contact_form_heading' => __('Send Your Message','weblizar'),
'contact_form_button' => __('Send Message','weblizar'),
'contact_footer_icon' => 'fa fa-phone',
'contact_footer_text' => __('EMERGENCY CALL','weblizar'),
'contact_footer_number' => __('+0 578 878 8543','weblizar'),
'google_map_url' => 'https://www.google.com/maps/embed?pb=!1 ... 3011812035',

I also Modified this part:

function hc_contact_setting(){
$wl_theme_options = get_option('health_pro_options');
$wl_theme_options['contact_detail_heading']= __('Contact Us','weblizar');
$wl_theme_options['contact_icon_1']='fa fa-map-marker' ;
$wl_theme_options['contact_icon_2']= 'fa fa-phone';
$wl_theme_options['contact_icon_3']= 'fa fa-map-marker';
$wl_theme_options['contact_icon_4']= 'fa fa-envelope';
$wl_theme_options['contact_heading_1']= __('Address','weblizar');
$wl_theme_options['contact_heading_2']= __('Phone','weblizar');
$wl_theme_options['contact_heading_3']= __('Headquarter','weblizar');
$wl_theme_options['contact_heading_4']= __('Email','weblizar');
$wl_theme_options['contact_detail_1']= __('Honey Buiseness Twenty Fourth St, Los Angeles, USA','weblizar');
$wl_theme_options['contact_detail_sub_1']= __('Sub Details 1','weblizar');
$wl_theme_options['contact_detail_2']= __('+91 9876543210, 1234567890','weblizar');
$wl_theme_options['contact_detail_sub_2']= __('Sub Details 2','weblizar');
$wl_theme_options['contact_detail_3']= __('Joney Buiseness Twenty Fourth Angeles, 1 USA, Earth, Milkyway Galaxy.','weblizar');
$wl_theme_options['contact_detail_sub_3']= __('Sub Details 3','weblizar');
$wl_theme_options['contact_detail_4']= __('weblizar@gmail.com','weblizar');
$wl_theme_options['contact_detail_sub_4']= __('Sub Details 4','weblizar');
$wl_theme_options['contact_form_heading']= __('Send Your Message','weblizar');
$wl_theme_options['contact_form_button']= __('Send Message','weblizar');
$wl_theme_options['contact_footer_icon']= 'fa fa-phone';
$wl_theme_options['contact_footer_text']= __('EMERGENCY CALL','weblizar');
$wl_theme_options['contact_footer_number']= __('+0 578 878 8543','weblizar');
$wl_theme_options['google_map_url']= 'https://www.google.com/maps/embed?pb=!1 ... 3011812035';
update_option('health_pro_options', $wl_theme_options);
}

Then I modified option-settings as follows:

<div class="tab-pane col-md-12" id="contact">
<div class="col-md-12 option">
<h1><?php _e('Contact Option','weblizar'); ?></h1>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#contact-setting"><?php _e('Contact Option','weblizar'); ?></a></li>
</ul>
<div class="tab-content">
<div id="contact-setting" class="tab-pane fade in active">
<form action="post" id="weblizar_theme_options_home-contact">
<div class="row restore">
<div class="weblizar_settings_loding" id="weblizar_loding_home-contact_image"></div>
<div class="weblizar_settings_massage" id="weblizar_settings_save_home-contact_success" ><?php _e('Options Data updated','weblizar');?></div>
<div class="weblizar_settings_massage" id="weblizar_settings_save_home-contact_reset" ><?php _e('Options data Reset','weblizar');?></div>
<input class="button button-primary right" type="button" value="Save Options" onclick="weblizar_option_data_save('home-contact')" >
<input class="button right" type="button" name="reset" value="Restore Defaults" onclick="weblizar_option_data_reset('home-contact');">
</div>
<div class="col-md-12 form-group">
<label><?php _e('Contact Details Heading','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_detail_heading" id="contact_detail_heading" value="<?php if($wl_theme_options['contact_detail_heading']!='') { echo esc_attr($wl_theme_options['contact_detail_heading']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Type here Your Contact Details Heading','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<?php for($i=1; $i<=4; $i++){ ?>
<div class="col-md-12 form-group">
<label><?php _e('Detail Heading ','weblizar'); echo $i; ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_heading_<?php echo $i; ?>" id="contact_heading_<?php echo $i; ?>" value="<?php if($wl_theme_options['contact_heading_'.$i]!='') { echo esc_attr($wl_theme_options['contact_heading_'.$i]); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Type here Your Details Heading ','weblizar'); echo $i; ?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Detail Icon ','weblizar'); echo $i; ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_icon_<?php echo $i; ?>" id="contact_icon_<?php echo $i; ?>" value="<?php if($wl_theme_options['contact_icon_'.$i]!='') { echo esc_attr($wl_theme_options['contact_icon_'.$i]); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Type here Your Details Icon ','weblizar'); echo $i;?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Detail Information ','weblizar'); echo $i; ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_detail_<?php echo $i; ?>" id="contact_detail_<?php echo $i; ?>" value="<?php if($wl_theme_options['contact_detail_'.$i]!='') { echo esc_attr($wl_theme_options['contact_detail_'.$i]); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Type here Your Details Information ','weblizar'); echo $i;?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<!--Start of my added code -->
<div class="col-md-12 form-group">
<label><?php _e('Detail Information sub ','weblizar'); echo $i; ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_detail_sub_<?php echo $i; ?>" id="contact_detail_sub_<?php echo $i; ?>" value="<?php if($wl_theme_options['contact_detail_sub_'.$i]!='') { echo esc_attr($wl_theme_options['contact_detail_sub_'.$i]); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Type here Your Sub Details Information here ','weblizar'); echo $i;?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div><!--end of my added code -->

<?php } ?>
<div class="col-md-12 form-group">
<label><?php _e('Contact Form Heading','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_form_heading" id="contact_form_heading" value="<?php if($wl_theme_options['contact_form_heading']!='') { echo esc_attr($wl_theme_options['contact_form_heading']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Contact Form Heading','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Contact Form Button Text','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_form_button" id="contact_form_button" value="<?php if($wl_theme_options['contact_form_button']!='') { echo esc_attr($wl_theme_options['contact_form_button']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Contact Form Button Text','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Contact Callout Icon','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_footer_icon" id="contact_footer_icon" value="<?php if($wl_theme_options['contact_footer_icon']!='') { echo esc_attr($wl_theme_options['contact_footer_icon']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Contact Callout Icon','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Contact Callout Text','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_footer_text" id="contact_footer_text" value="<?php if($wl_theme_options['contact_footer_text']!='') { echo esc_attr($wl_theme_options['contact_footer_text']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Contact Callout Text','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Contact Callout Contact Number','weblizar'); ?></label><br/>
<div class="col-md-6">
<input class="form-control" type="text" name="contact_footer_number" id="contact_footer_number" value="<?php if($wl_theme_options['contact_footer_number']!='') { echo esc_attr($wl_theme_options['contact_footer_number']); } ?>" >
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Contact Callout Contact Number','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="col-md-12 form-group">
<label><?php _e('Google Map Embeded URL','weblizar'); ?></label><br/>
<div class="col-md-6">
<textarea class="form-control" type="text" name="google_map_url" id="google_map_url" ><?php if($wl_theme_options['google_map_url']!='') { echo esc_attr($wl_theme_options['google_map_url']); } ?></textarea>
</div>
<div class="col-md-6">
<label><a href="#" data-toggle="tooltip" data-placement="right" title="<?php _e('Google Map Embeded URL','weblizar');?>"><i class="fa fa-info-circle tt-icon"></i></a></label>
</div>
</div>
<div class="row restore">
<input type="hidden" value="1" id="weblizar_settings_save_home-contact" name="weblizar_settings_save_home-contact" />
<input class="button left" type="button" name="reset" value="Restore Defaults" onclick="weblizar_option_data_reset('home-contact');">
<input class="button button-primary left" type="button" value="Save Options" onclick="weblizar_option_data_save('home-contact')" >
</div>
</form>
</div>
</div>
</div>
</div>

Here is what the admin panel looks like now:

Image

However, it is not loading default settings in the admin page and I can't call the variable in the contact page. Please help. Thank you.

support_staff
Posts: 7275
Joined: February 26th, 2015, 1:40 pm

Re: Modifying Admin Theme Options

Post by support_staff » December 13th, 2016, 12:38 pm

please send the temp access of site with url at lizarweb[at]gmail[dot]com
We'll resolve the issue asap.


Note: please mention the link of this forum in mail.
Thanks.

support_staff
Posts: 7275
Joined: February 26th, 2015, 1:40 pm

Re: Modifying Admin Theme Options

Post by support_staff » December 15th, 2016, 5:09 pm

access get

Post Reply

Return to “Theme Installation, Settings & Configuration, Problem, Error & Bug”