Bring page from sub menu to admin menu in option tree

Add this to your functions.php file – add_filter(‘ot_theme_options_parent_slug’, ‘__return_false’); Basically it’s a filter (ot_theme_options_parent_slug) added by the plugin author and the usage is simple like I provided here. You may consider looking at this page for all available filters for “Option-Tree” plugin – https://github.com/valendesigns/option-tree/blob/master/includes/ot-functions-admin.php By adding this filter, you can pass any function and adjust … Read more

Let user to add input fields on theme option page

You can do this by adding the following class in your theme for admin options; Custom-Metaboxes-and-Fields-for-WordPress And you can call your repeatable fields with some thing like this; array( ‘name’ => ‘Name of field’, ‘id’ => ‘prefix_option_name’, ‘type’ => ‘text’, ‘default’ => ”, ‘repeatable’ => true, ), For more details on how to use this … Read more

How to get DB options format without saving? [closed]

As I mentioned here those 2 ajax actions, here is how you can use the second action that extracts form values in db format Create an ajax action that will return the settings options You can add this code to {theme}/functions.php or to {theme}/inc/hooks.php function _action_ajax_fw_theme_get_settings_options() { wp_send_json_success(array( ‘options’ => fw()->theme->get_settings_options() )); } add_action( ‘wp_ajax_fw_theme_get_settings_options’, … Read more

WordPress Theme Settings Page

This is wrong: add_theme_page(“Theme Panel”, “Theme Panel”, “manage_options”, “theme-panel”, “initialize_theme_options”, null, 99); The last two parameters shouldn’t be there. Check this function in codex here. EDIT: What’s more, the last parameter (which should be there) initialize_theme_options is wrong too, because it should be a callback to a function which would output a content. So for … Read more

How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?

I suggest you take a look at the Kirki toolkit: https://github.com/aristath/kirki It has a “repeater” field that should do what you need. It’s still under heavy development and for the time being I’ve only added the ability to use a few field-types with it, so I guess it depends on what exactly the data you … Read more

WP Page Options Array

After much experimentation I resolved my own question and this answer might help somebody. function mmm_select_field( ) { $options = get_option( ‘mmm_settings’ ); $buttons = array( ‘Bold’ => ‘bold’, ‘Italic’ => ‘italic’, ‘Underline’ => ‘underline’, ‘Superscript’ => ‘superscript’, ‘Align Left’ => ‘alignleft’, ‘Align Center’ => ‘aligncenter’, ‘Align Right’ => ‘alignright’, ‘Bullet List’ => ‘bulletlist’, ‘Number … Read more

How to use WP Theme Option: Custom_Backgrounds on specific element?

If your theme uses in-built custom-background callback then you can overwrite add_theme_support in your child theme. Yo do not need to use remove_theme_support. First add custom-background support with your callback function. $defaults_args = array( ‘wp-head-callback’ => ‘my_custom_background_cb’, ); add_theme_support( ‘custom-background’, $defaults_args ); In callback function specify div CSS class or ID function my_custom_background_cb() { $bg_image … Read more

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