Echo get_option displays as text

If you really want to execute code stored in a database, a quick google search reveals that you can use the eval() function to do just that. However, many people do say that Eval is Evil… Instead of storing the entire PHP code of an option in the database, try storing a simple boolean flag … Read more

Woo Commerce Settings for Check-out Form [closed]

This is unlikely to be a Woocommerce setting, or if it is in the Woocommerce settings, it has been added by an additional plugin from the theme maker. Check your theme settings, or for a widget that is configured to appear on user account pages. Since the CSS style .avada_myaccount_user is being used for this … Read more

What type to upload image within theme options?

If using image radio buttons, define a directory path here is code. I hope its going work. $imagepath = get_template_directory_uri() . ‘/images/’; $options = array(); $options[] = array( “name” => __(‘Logo’, ‘prothemeus’), “desc” => __(‘Upload your logo’, ‘prothemeus’), “id” => “pt_logo”, “type” => “upload”);

illegal offset in option add

The array is ‘hidden’ inside the form elements. Their respective name/ID is like MY_option_name[some_other_name]. That is the array structure. // Edit (to elaborate a little on that) Suppose you have the following form: <form action=”options.php” method=”post”> Font:<br /> <input type=”text” name=”MY_options[font]” id=”MY_options[font]” /> Color:<br /> <input type=”text” name=”MY_options[color]” id=”MY_options[color]” /> <?php submit_button(); ?> </form> If … Read more

Fatal error: Call to undefined function get_option()

I don’t see any get_option() function on line 9 or anywhere else in your code. After quick googling, my guess would be that your problem is the same as this question on stackoverflow EDIT As @Ray proposed at the linked question, paste this in your code to check if wp-includes/option.php is included: $includedStuff = get_included_files(); … Read more

Where to adjust presets for slider options “auto rotate” (3, 5, 10, 15 seconds)? [closed]

In anybody needs this in the future I found a quick and easy workaround: you could just adjust the slider interval in the shortcode. First you have to switch to the “classic mode” (turn the Visual Composer off) and then find the shortcode that defines the interval: [vc_gallery interval=”10″ images=”22390,23006″ img_size=”full”] You can then set … Read more

Using get_option() for check box field

This may not exactly answer the question, but let’s see the issues with your code: If you want to save the data in the same format as the default value ($fields_default), then: Start your foreach like so: foreach ( $orderdescider as $i => $item ). Then inside that foreach, $id and $checkbox should always be … Read more

selecting options from another form

In the following line: $select_branch = $wpdb->get_results($wpdb->prepare(“SELECT * FROM $table_name”));, you are using $wpdb->prepareincorrectly. wpdb::prepare needs two arguments, first one is a Query string with sprintf like placeholders and second an array of the values to to substitute the placeholders. More details here. And that is the error you are getting as posted on top … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)