fbpx
  1. Home
  2. Developer
  3. Page 4

Chapter: Developer

Snippets, actions, filters, examples of changing theme using code

Custom Post Type – Add Theme Metaboxes and Theme settings Metaboxes

If you have created a custom post type and you want to have the KLEO theme options panel for each custom post type // Add Theme Settings to CPT // // Replace yourCPTslug with your CPT slug // function my_cpt_sq_metabox_general_settings($post_types) { $post_types[] = ‘yourCPTslug’; return $post_types; } add_filter(‘sq_metabox_general_settings’, ‘my_cpt_sq_metabox_general_settings’); Add this function to wp-content/thems/kleo-child/function.php

Remove KLEO from WordPress TinyMCE

If you need to remove the KLEO button from WordPress TinyMCE you will have to add this function add_action( ‘admin_init’, ‘sq_remove_admin_shortcodes_btn’, 12 ); function sq_remove_admin_shortcodes_btn() { global $k_elements_tiny; remove_filter( ‘mce_external_plugins’, array( $k_elements_tiny, ‘add_rich_plugins’ ) ); remove_filter( ‘mce_buttons’, array( $k_elements_tiny, ‘register_rich_buttons’ ) ); } The above code function needs to be pasted in wp-content/themes/kleo-child/functions.php If you have a k-elements lower than […]

Ajax Interval Refresh – Menu Notifications & Messages

Kleo theme has a feature that checks messages and notifications only when BuddyPress plugin is activated. If your website has significant traffic it may be needed to increase the AJAX interval refresh from Wp-admin -> Theme options -> Buddypress -> Live notifications interval and add a higher value like 60000 (60 seconds). Also there it’s a programmatically way to do that […]

Dequeue and deregister the APP.JS theme file and load it from child theme.

Using the next snippet you will be allowed to de-register and dequeue APP.js or APP.min.js file from parent theme wp-content/themes/kleo/assets/js/app.js and to load your own customized or modified app.js file from child from this location : wp-content/themes/kleo-child/assets/js/app.js /* Deregister the APP.JS from parent and loade it from custom location (child theme)*/ function sq7r_deregister_app_js() { $min = sq_option( ‘dev_mode’, 0 ) […]