Dynamic Control in customiser

Figured it out, you have to create a new class extending WP_Customize_Control: // Add Layout setting $wp_customize->add_setting( // ID ‘sidebar_left_selection’, // Arguments array array( ‘default’ => ‘none’, ‘sanitize_callback’ => ‘webcodexcustomizer_sanitize_sidebar_selection’ ) ); class customize_sidebar_selection extends WP_Customize_Control { public function render_content() { global $wp_registered_sidebars; // The actual fields for data entry $output = “<span>” . esc_html( … Read more

WordPress API functions not working at AJAX functions.php call

Your problem is probably because you do not return a json object but an html (actually mixed text and html), and you set jQuery to validate that the response is json, which it isn’t. your code at the ajax handler should be something like $catshtml = wp_dropdown_categories(…..echo=0); $ret = array(‘data’ => $catshtml); wp_send_json($ret); die(); on … Read more

Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS

I wanted to achieve the same thing.. What I ended up doing was creating a function that collects the Kirki variables (see here about the use of variables in Kirki) and writes them to a scss.. $file = get_template_directory() . ‘/sass/custom/_custom_vars_mixins_options.scss’; if(file_exists($file)){ $output = “”; $variables = Kirki::get_variables(); foreach ( $variables as $variable => $vvalue … Read more

where to change text for header?

You can use twentyfifteen_custom_header_args filter for customizing width and height. Check following example. add_filter( ‘twentyfifteen_custom_header_args’, ‘theme_slug_custom_header_args’ ); function theme_slug_custom_header_args( $args ){ $args[‘width’] = 600; $args[‘height’] = 800; return $args; } In the example, width is changed to 600 and height is set to 800.

How can I move Customizer menu item to first level in WP Dashboard?

The function below should help you. It removes the default menu item from the “Apperance” menu item and a new menu item to the Dashboard. add_action( ‘admin_menu’, ‘fb_customize_admin_menu_hide’, 999 ); function fb_customize_admin_menu_hide(){ global $submenu; // Remove Appearance – Customize Menu unset( $submenu[ ‘themes.php’ ][ 6 ] ); // Create URL. $customize_url = add_query_arg( ‘return’, urlencode( … Read more

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