Is there any way to add placeholder for WordPress Customizer text input fields

You can use the input_attrs argument to pass attributes to the input: $wp_customize->add_control(‘directorist_address’, array( ‘label’ => __(‘Address’, ‘directorist’), ‘section’ => ‘directorist_contact’, ‘settings’ => ‘directorist_address’, ‘description’ => __(‘Enter your contact address. Eg. Abc Business Center, 123 Road, London, England’, ‘directorist’ ), ‘input_attrs’ => array( ‘placeholder’ => __( ‘Placeholder goes here…’, ‘directorist’ ), ) ) );

Different customizer previewUrls per section

You could use active_callback property to delegate section visibility depending on current preview screen. $wp_customize->add_section( ‘my-section’, array( ‘title’ => __( ‘Section Title’ ), ‘active_callback’ => ‘is_shop’, ) ); Or custom $wp_customize->add_section( ‘my-section’, array( ‘title’ => __( ‘Section Title’ ), ‘active_callback’ => ‘is_custom_condition’, ) ); function is_custom_condition(){ $condition_is_met = //Some boolean returning logic; if( ! $condition_is_met … Read more

How to upload multiple images with WP_Customize_Media_Control

Use this JQuery for multiple image uploads: <!– js multi image –> jQuery(document).ready(function($) { // add image uploader functionality var meta_image_frame; $(‘.meta-image-button’).live(‘click’, function(e){ e.preventDefault(); if( meta_image_frame ){ wp.media.editor.open(); return; } meta_image_frame = wp.media.frames.file_frame = wp.media({ title: ‘Portfolio Image Gallery Selection Window’, button: {text: ‘Add to Gallery’}, library: { type: ‘image’}, multiple: false }); meta_image_frame.on(‘select’, function(){ … Read more

Need help setting default setting value for radio button in theme customizer

It is a long question but it is possible for some developers I would like to give this answer. Example: I have two choose for my home layout Grid and List and I prefer Grid is default choosing. I should add default value in add_setting simple like this ‘default’ => ‘grid’. $wp_customize->add_setting(‘yourtheme_home_layout_style’, array( ‘sanitize_callback’ => … Read more

WP Customizer – Prevent live preview

Visit this link and read about transporter argument: https://codex.wordpress.org/Theme_Customization_API Is that what you are looking for? Here is an example for you: <?php add_action( ‘customize_register’, ‘my_customizer’ ); function my_customizer($wp_customize){ $wp_customize->add_section( ‘my_section’, array( ‘title’ => __( ‘My Custom Section’, ‘mytheme’ ), //Visible title of section ‘capability’ => ‘edit_theme_options’, //Capability needed to tweak ) ); $wp_customize->add_setting( ‘my_setting’, … Read more

Disable Visible Edit Shortcuts in the Customizer

The simplest way to disable edit shortcuts without unwanted side effects is to no-op override the JS function that generates them in the first place. You can do this from PHP as follows: add_action( ‘wp_enqueue_scripts’, function () { $js=”wp.customize.selectiveRefresh.Partial.prototype.createEditShortcutForPlacement = function() {};”; wp_add_inline_script( ‘customize-selective-refresh’, $js ); } ); This will work for any theme.

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