Questions tagged [theme-customizer]

The Customizer is a framework for staging changes in WordPress. Settings may model anything in a given site (options, theme mods, widgets nav menus, posts, etc.) and the changes are bundled into changesets which are then previewed, saved as drafts, and even scheduled. Themes and plugins alike may extend the Customizer. Questions should be posed related to the Customize API in WordPress, in either PHP and JS.

293 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
152 views

Hook in wp.media to add a new tab

This is an issue coming up while creating a plugin. I want to add a tab to the wp.media.view.MediaFrame.Select modal or if a general approach helps: In the customizer I want to hook in any modal ...
6
votes
1answer
273 views

Theme Customization API and child themes

I've recently developed a parent theme that makes heavy use of the Theme Customization API. Is there an easy way to port these settings when a user activates one of my child themes? Currently, the ...
5
votes
1answer
631 views

Color Picker (iris) in widget - refresh when edited in Customizer

I have added the WordPress Core color picker (iris) to a widget I developed, but when I edit the color, there is no change triggered. As a result, the iframe (live preview) for the Customizer does not ...
5
votes
1answer
2k views

How to refresh Theme Customizer after change color inside wpColorPicker?

I develop my custom widget with setting where I can set up custom color for the widget. I use this code to initialize wpColorPicker instead of default text input in form() method of Widget class: ...
5
votes
1answer
116 views

Can I create customizer setting that can handle plugin shortcode?

Can I create a customizer setting which will handle a shortcode from a plugin? Do I violate and rules or guidelines in WordPress theme development? If it's possible what is the best way to sanitize ...
4
votes
1answer
179 views

get_theme_mod doesn't return the theme customizer preview's new values in after_setup_theme hook

If I print the value of get_theme_mod( 'enable_sleek_header', false ) it is always the previously saved value. If I print the same thing in the header of the theme, it returns the value from ...
4
votes
1answer
485 views

Looking for a way to load a function after customizer preview refresh complete

I need to load a callback function after a wp.customize.previewer.refresh(). I need this because I want to update a template position which is displayed with a custom hook in my theme and scroll the ...
4
votes
1answer
154 views

Detecting Wordpress Customizer Panel

Recently started developing a Wordpress theme relying heavily on the customizer API. One thing I'm stuck with is detecting when a specific panel has been clicked or opened. Regular old "on click" ...
3
votes
1answer
75 views

Is it still possible to nest panels within panels within the customizer?

As the title states, I am trying to make some advanced settings in the customizer which would be way more organized if I could have some panels nested within other panels. I found a similar question ...
3
votes
0answers
110 views

Send data from Customizer Settings to Customizer Preview with settingless control

There are a few ways to speak back and forth with the customizer API. I don't think my scenario is that much f an offshoot so I will give it to you. I have a button in the Customizer to trigger a PHP ...
3
votes
2answers
1k views

How do I handle the “WP_Customize_Cropped_Image_Control” callback?

I want to make a logo manager in the Customizer, but how do I set different image sizes with the WP_Customize_Cropped_Image_Control class? Example from Make WordPress Core: $wp_customize->...
3
votes
0answers
813 views

How to overwrite JS variable with wp_localize _script?

The function wp_localize_script( $handle, $name, $data ); does not work when trying to overwrite the same variable, that is when calling the function second time with the same $handle and $name but ...
3
votes
0answers
54 views

Need to run a plugin on Customize.php

I'm running a multisite installation and have a plugin installed that lets users that are given a user meta option to be their specific role on any site that they aren't associated with. So if they ...
3
votes
0answers
251 views

Theme Customiser not live previewing changes on pseudo elements

I've been working with the Theme Customiser API lately and found that pseudo elements are not live updating using the previewer. In my project I have an image containing a transparent overlay using ...
3
votes
1answer
616 views

Customizer preview doesn't update get_option() value properly

I have a setting in index.php if(get_option('cb2_blog_home')){ cb_get_blog_links(); } This code allows the home page blog index to be turned on and off. The cb_get_blog_links() function draws ...
3
votes
1answer
198 views

Is it possible to display the admin bar while in the Theme Customizer?

I've been using Debug Bar + Kint Debugger for debugging. Presently I'm working on a custom theme where I'm trying to hook some code into customize_save_after. The code doesn't appear to be running ...
2
votes
0answers
61 views

How to check if customize previewer is refreshing?

I am trying to send data from customize control to customize previewer. The scripts work fine until the customize previewer is refresh. The problem is only the previewer is refresh, the customize ...
2
votes
1answer
72 views

Can the Theme Customizer be used to generate static/cachable CSS, and how?

I am currently trying to make a customizable Bootstrap theme for my personal WordPress site, however, I am running into some issues. Bootstrap can be customized by modifying the SCSS variables, and I ...
2
votes
1answer
38 views

How to hook CSS file according to theme selection in the customizer section

I have added a new area in the Customizer section which allows a user to choose whichever theme colors they want: But I don't know how to activate/add CSS files according to the selection. i.e. add ...
2
votes
1answer
4k views

“You need a higher level of permission” after admin changing. Why?

I can't edit my website, when I try to edit, I see the page with the message: You need a higher level of permission. Sorry, you are not allowed to customize this site. It was started when I create ...
2
votes
0answers
110 views

New customizer setting not showing value

Edit: It's working now, please lock the thread. I am using the Understrap framework (Underscores plus Bootstrap). $wp_customize->add_section( 'understrap_theme_post_options', array( 'title' ...
2
votes
0answers
515 views

Theme Customizer - My panel disappears

I have a problem, I create my panel in a normal way, but when I see it after 1 second it disappears, I do not understand what is happening, does anyone know why? Link Video: http://recordit.co/...
2
votes
0answers
477 views

Customizer Selective Refresh doesn't refresh properly with saved value

I've been stuck on this for a few days, even looking up several questions, guides, and source code. Something to me is just wrong but I can't exactly figure it out. Objective: I need to use a ...
2
votes
1answer
225 views

WP Customizer JS Template not saving color field

I'm trying to create a custom typography control, I'm having problem saving the value of the color, please take a look at my code: <?php class Customizer_Typo_Control_Typography extends ...
2
votes
1answer
1k views

Get_theme_mod not retrieving value

I'm using the Wordpress customizer feature to configure my theme and I constantly bumping into the same annoying issue, sometimes I don't get any value from get_theme_mod while I see the effect of my ...
2
votes
2answers
2k views

Customizer Show/Hide Logo and Site Title

I've setup checkbox controls in my theme Customizer to show/hide the Logo and Site Title when they are checked/unchecked. By default, I want the Logo to display and the Site Title to be hidden. ...
2
votes
1answer
259 views

Get/Set wp.customize.previewer.previewUrl

I am trying to get/set the current previewURL within the Customizer. I enqueue the script with the customize_controls_print_styles action: function my_custom_script() { wp_enqueue_script( 'my-...
2
votes
1answer
26 views

How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?

I currently have a theme with OptionTree installed. It is used to create a list of locations which are then visible in a dropdown in the header of the page. The display code with OptionTree looks like ...
2
votes
1answer
51 views

Change setting name in Customizer and keep the data

I created a theme while back when I was new to Customizer API and for some weird reasons I named theme settings as: $wp_customize->add_setting('thefunk_theme_options[header_color] Instead of just ...
2
votes
2answers
2k views

Widgets panel not displaying in the Theme Customizer

I am using the Theme Customizer to let users customize how their website looks. I noticed on the Twenty Fifteen theme there is a panel for Widgets. I have seen this on quite a few other themes too, ...
2
votes
0answers
147 views

Hide Text when check box option is ticked in customizer?

How I hide the Head Text which is "Magna Aliquam" when "Hide Head Text" checkbox is checked and show when the checkbox is unchecked. Below is my code, but I'm lost. Any help would be appreciated wp....
2
votes
1answer
363 views

How can I use a $wp_customize to edit my homepage image slider?

This is my first post here, but I've been doing a bit of searching. I want to use the Custom Theme API to create add a customized theme control to add a new Image to a slider. Here is some of the code:...
2
votes
1answer
641 views

Using jQuery to retrieve customizer value

I am trying to use jQuery to retrieve a theme options (customizer) value: $wp_customize->add_setting( 'header_fixed', array( 'default' => true, ) ); $wp_customize->...
2
votes
0answers
560 views

Adding Controls to Theme Customizer If Certain Page Template is Active

How to Conditionally add controls on Theme Customizer panel. Conditional like is_page() or is_page_template() obviously does/will not work because the page is being shown is customize.php. Code ...
2
votes
2answers
152 views

How can a default site icon be set in customizer?

From my research there are only two questions I've found around this topic on this site: How to change in customizer the “site identity” tab required capabilities how to change default icon of custom ...
1
vote
0answers
17 views

Translations appear in the WP Customizer, but not on the website!

I have a strange issue: I have translated my website into 2 languages with the Polylang plugin. Main language is French, translations EN and ES. Some strings (like Read more, x Comments, No Comments, ...
1
vote
0answers
15 views

How do i make a custom section's setting display the default value in Customizer?

Have made a custom section that displays in the Customizer. It has controls for image upload and text inputs for both the heading and its link. I want to be able to show a default heading and link ...
1
vote
0answers
14 views

customizer options not showing

I have a wordpress installation where the customize options have disappeared. I already disabled all plugins, but it did not solve the problem. What more can I do? Thanks in avance.
1
vote
0answers
22 views

Dynamically loaded Theme components based on Customizer Settings values : changes not appearing in Customizer preview - (Workaround found)

I'm trying to create a WP theme (for personal learning purposes, still pretty new to wp) where Header/Container/Footer are each chosen based on a dedicated customizer setting (still plain text, ...
1
vote
0answers
15 views

Customizer's “Imported Fonts” - How To Use Them?

How do I use the "imported fonts" options in WordPress's customize > fonts > choose font > "imported fonts" section? Trying to find info about this, but apparently no one's mentioned this anywhere. ...
1
vote
0answers
27 views

Plugin options page with live preview?

I want to build a plugin page with form options and a live preview to auto refresh and display the changes on the frontend. Is it possible to show a live preview of the frontend in the plugin options ...
1
vote
0answers
8 views

Add media library items to Menus using the Customizer (via Media Manager not URL)

You can add links to files in the media library URL via the Custom Links panel of the Customizer but for clients this requires multiple steps including cutting and pasting a URL from the media library ...
1
vote
1answer
18 views

How do I make HTML output work when using the customizer?

How do I make HTML code that is written in the customizer output properly? I need a line break to appear where it has been placed but I am not to get it to output properly.
1
vote
0answers
87 views

How to Get WP_Customize_Image_Control content?

I want to get WP_Customize_Manager controls from my frontend with ajax. This is possible? I looking for a solution on the internet, but I have not found so far any useful documentation about this... ...
1
vote
1answer
107 views

How To Remove or Hide Appearance->Background from Admin Menu

I have a menu Appearance->Background on WP admin, i want to remove or hide from Editor user. i was try to using public function remove_menu() if( !current_user_can( 'administrator' )){ { if( !...
1
vote
0answers
16 views

Child Theme disable customizer defaults

I am trying to extend twentyseventeen theme. I want to achieve two simple goals. No custom header image Don't show the Title and tagline by default. But I would like to keep those options available ...
1
vote
1answer
70 views

How to hook on customizer section expanded/active/opened event?

I am trying to run js function when customizer section is expended and cant seem to find any event to do so. Something like this wp.customize.bind( 'ready', function() { wp.customize.section....
1
vote
1answer
130 views

How to add styles set by user in the customizer

I want my theme to be very customizable, and so far i have provided the possibility to change text and link colors to the body, plus the background color which comes by default (I'm using the ...
1
vote
0answers
60 views

Custom slider throwing an error

Hi am using Customised slider in my theme from another theme I add this code in my customizer.php function mytheme_customize_register( $wp_customize ) { //Slider $wp_customize->...
1
vote
1answer
74 views

Widget changes in customizer ajax error to many options?

Just testing frontend widget changes via customizer and I am not even able to change the title. Ajax response says {"success":false,"data":"widget_setting_too_many_options"} There is also a notice ...

1 2 3 4 5 6