Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Creating Simple Option Tree In the theme-->
- <?php
- add_action( 'admin_init', 'custom_theme_options', 1 );
- function custom_theme_options() {
- $saved_settings = get_option( 'option_tree_settings', array() );
- $custom_settings = array(
- 'contextual_help' => array( //This is help section if u want create
- 'content' => array( //anoter this just create anothe array
- array( // like this with ,
- /* array(
- 'id' => 'Home_Top_help',
- 'title' => __( 'Home_Top'),
- 'content' => '<p>' . __( 'You can edit Top page from hare ', 'theme-text-domain' ) . '</p>'
- )*/
- 'id' => 'Home_Top_help',
- 'title' => __( 'Home_Top'),
- 'content' => '<p>' . __( 'You can edit Top page from hare ', 'theme-text-domain' ) . '</p>'
- )
- )
- ),
- 'sections' => array(
- array(
- 'id' => 'general',
- 'title' => 'Site Settings'
- )
- ),
- 'settings' => array(
- array(
- 'id' => 'logo_text',
- 'label' => 'Logo Text',
- 'desc' => 'Use H1, H2, H3 tag',
- 'type' => 'textarea',
- 'section' => 'general'
- ),
- array(
- 'id' => 'footer_text',
- 'label' => 'Footer Text',
- 'type' => 'textarea',
- 'section' => 'general'
- )
- )
- );
- if ( $saved_settings !== $custom_settings ) {
- update_option( 'option_tree_settings', $custom_settings );
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement