• Hi,

    I’m working with slightly modified options framework and need to use a drop down option.

    It looks like this in the SMOF

    $of_options_select 	= array("option 1","option 2","option 3");
    
    $of_options[] = array( 	"name" 		=> "Normal Select",
    						"desc" 		=> "Normal Select Box.",
    						"id" 		=> "example_select",
    						"std" 		=> "three",
    						"type" 		=> "select",
    						"options" 	=> $of_options_select
    				);

    I can display which option has been selected by using:

    echo do_shortcode(stripslashes($data['example_select']));

    If for example option 2 is selected, it will echo ‘option 2’

    I’m trying to make it so that…. if option 2 – then (custom code).
    Instead of it showing the array text I need it to do something depending on what has been selected, but not having much luck!

    Many thanks to anyone who can help with this!

Viewing 1 replies (of 1 total)
  • I have faced same issues. I can not add functions which will add a select options where I will able to select my stylesheet.

    Suppose, I have 3 stylesheet (red.css, blue.css and green.css). Now I want to add a fuctions in SMOF where I will able to select stylesheet and my wordpress site’s design will change according to stylesheet.

    My codes are below-

    //Stylesheets Reader
    		$alt_stylesheet_path = LAYOUT_PATH;
    		$alt_stylesheets = array();
    
    		if ( is_dir($alt_stylesheet_path) )
    		{
    		    if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) )
    		    {
    		        while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false )
    		        {
    		            if(stristr($alt_stylesheet_file, ".css") !== false)
    		            {
    		                $alt_stylesheets[] = $alt_stylesheet_file;
    		            }
    		        }
    		    }
    		}

    and

    $of_options_select 	= array("option 1","option 2","option 3");
    $of_options[] = array( 	"name" 		=> "Logo Uploader",
    						"desc" 		=> "Upload logo",
    						"id" 		=> "logo",
    						"std" 		=> "three",
    						"type" 		=> "select",
    						"options" 	=> $of_options_select
    				);

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • The topic ‘SMOF – drop down array’ is closed to new replies.