Making the HTML list to a checkbox tree with the plugin jstree [closed]

This worked for me. Basically jquery was missing through <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> and the wrong PHP tags. Thanks for that. You can find the full code below. <title> Hi all</title> <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/295053/<?php echo get_stylesheet_directory_uri().”/js/jstree/dist/themes/default/style.min.css’;?>” /> <div id=”data”> <ul> <li>One</li> <li>Two</li> <li>Three <ul> <li>Bike</li> <li>Ride</li> </ul> </li> <li>JOKE</li> </ul> </div> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> <script src=”<?php … 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

Retrieve uploaded image attibutes value from option tree theme options

Put this code in index.php <img class=”img-resposive” src=”https://wordpress.stackexchange.com/questions/218286/<?php $logo=get_option_tree(“logo’,”,’true’); // return src of img $id_logo = get_attachment_id_from_src($logo); // This is custom function for getting image id. $alt = get_post_meta($id_logo, ‘_wp_attachment_image_alt’, true);// get alt=”” from wordpress media. if ( function_exists( ‘get_option_tree’) ) : if( get_option_tree( ‘logo’)) : $logo; else: echo bloginfo(‘template_directory’) .’/assets/images/logo_vp.png’; // else if option … Read more

How to extend parent theme sections and settings to Options Tree

For anyone who want to achieve the same thing : add_filter( ot_settings_id() . ‘_args’, ‘my_ot_setting’); function my_ot_setting($custom_settings){ //do some work with the settings and the sections, ie append your settings. return $custom_settings; } This works if the parent theme applies this filter before saving the options like the example here : https://github.com/valendesigns/option-tree-theme/blob/master/inc/theme-options.php#L833 Otherwise you have … Read more

How To Add New Option Types To Option Tree?

What you’re trying to do can be accomplished without ever editing the core files in OptionTree. Add your custom option type functions to your themes functions.php and the following code, as well. /** * Filter to add custom option types. * * @param array An array of option types. * @return array */ function add_custom_option_types( … Read more

What are the advantages and disadvantages of Option Tree over the Customization API?

disadvantage using option tree: Your theme depend on other work as a core You need to always keep an eye for the plugin update ( which is really not good if you’re going to use it in premium theme ) If you’re going to integrate it in your theme, then when there is update from … Read more