make an array in wordpress cusmization api
-
i’m trying to make an array in wordpress customize.php i do used wp_localize_script in function.php as follow
function mytheme_scripts() { wp_register_script('scripts', get_template_directory_uri() . '/assets/js/scripts.js', 'jquery'); $my_array = array( 'zoom' => get_theme_mod('zoom'), 'letter-spacing' => 'letter-spacing', 'rotate' => 'rotate', 'left' => 'left' ); wp_localize_script( 'scripts', 'effect', $my_array ); wp_enqueue_script('scripts'); } add_action( 'wp_enqueue_scripts', 'mytheme_scripts' );in scripts.js im trying to change the effect using this
scrollorama.animate('.para-welcome',{ delay: 200, duration: 300, property:'var para = effect.zoom;', start:0 });my settings and controls are
$wp_customize->add_setting( 'parallax_effect' , array( 'default' => 'zoom', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'parallax_effect', array( 'label' => 'Parallax effect', 'section' => 'mytheme_welcome', 'settings' => 'parallax_effect', 'type' => 'select', 'choices' => array( 'zoom' => 'zoom', 'letter-spacing' => 'letter-spacing', 'rotate' => 'rotate', 'left' => 'left', ) ) );but it’s not working yet i used all solutions i found but no changes
any way i need to add select menu to change parallax effects of any section can any one help please
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘make an array in wordpress cusmization api’ is closed to new replies.