Theme Options Logo
Thu Aug 25 2022 15:37:52 GMT+0000 (Coordinated Universal Time)
Saved by
@hamzahanif192
function mytheme_customize_register( $wp_customize ) {
$wp_customize->add_section( 'mytheme_company_section' , array(
'title' => __( 'Custom Theme Option', 'mytheme' ),
'priority' => 30,
));
$wp_customize->add_setting( 'mytheme_company-name', array());
$wp_customize->add_control( new WP_Customize_Upload_Control(
$wp_customize,
'mytheme_company_control',
array(
'label' => __( 'Company Name', 'mytheme' ),
'section' => 'mytheme_company_section',
'settings' => 'mytheme_company-name',
'priority' => 1
)
)
);
// ..repeat ->add_setting() and ->add_control() for mytheme_company-division
}
add_action( 'customize_register', 'mytheme_customize_register' );
// How to get
echo get_theme_mod( "mytheme_company-name" );
content_copyCOPY
Comments