Radio Image
-
I want to create multiple background with radio-image.
I was trying this code to call but it doesn’t work:if ( ot_get_option(body_background') != '' ) { $styles .= '.body{ background: '.ot_get_option('body_background').'; }'."\n"; }
My question is “the code” to call by value when I select each background.
Sorry for my ignorance. I hope u can answare my question because it was 3 days since I post this thread.The function code I put in function.php :
function filter_radio_images( $array, $field_id ) { if ( $field_id == 'body_background' ) { $array = array( array( 'value' => '1', 'label' => '1', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-1.png' ), array( 'value' => '2', 'label' => '2', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-2.png' ), array( 'value' => '3', 'label' => '3', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-3.png' ) ); } return $array; }
And code in demo-theme-options.php :
array( 'id' => 'color-header-menu100', 'label' => 'Header Menu Background 100%', 'std' => ' ', 'type' => 'radio-image', 'section' => 'styling', 'class' => '', 'choices' => array(), 'settings' => array( array( 'value' => '1', 'label' => 'bg1', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-1.png', 'choices' => array(), ), array( 'value' => '2', 'label' => 'bg2', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-2.png', 'choices' => array(), ), array( 'value' => '3', 'label' => 'bg3', 'src' => get_template_directory_uri() . '/functions/images/pattern/pattern-3.png' ) ) ),
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Radio Image’ is closed to new replies.