Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
12 views

How to check if a Customizer setting is set?

I'm trying to setup a function that writes a meta tag into the header of my site. Namely, I've set up a color chooser input like this: function customizer_options($wp_customize) { $wp_customize ...
0
votes
1answer
26 views

How to add “get_theme_mod” inside a shortcode?

I want to make dynamic the content inside a shortcode so I can modify it in the customizer. I created the customizer tabs. Now, I want to create a shortcode to place it anywhere in the page while ...
1
vote
0answers
19 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... ...
0
votes
0answers
15 views

Customizer control for including files in functions.php

I have the following include in my theme's functions.php file to add social sharing icons to my theme: require get_template_directory() . '/inc/social-sharing/social-sharing.php'; I would like the ...
0
votes
0answers
11 views

Kirki Customizer radio control

I'm using "kirki customizer", the homepage consists of a few styles (for example: homepage-1, homepage-2). How to use Kirki customizer-da radio control, how can I use it?
0
votes
0answers
21 views

Initial Customizer is_admin() but loading preview is neither is_admin() nor is_customize_preview()

When clicking from wp-admin into the Customizer, WordPress loads the Customizer (where is_admin() is true) and then loads all of WordPress a second time in order to generate the preview iframe, in ...
1
vote
1answer
17 views

WordPress code editor VS customizer “built-in CSS editor”?

I needed to make some CSS changes to my WordPress site (child theme) earlier and opened the WordPress editor inside "Appearance": Appearance > Editor > someCssFile.css Inside the editor page, ...
0
votes
0answers
9 views

How to display specific title on Customizer?

Please find the below image. It will be more clear to understand my question. I want to display the title that has been shown on above image in the Customizer. How can I do that?
0
votes
1answer
24 views

Woocommerce section name? [closed]

What is the customizer section name? I want to add a field option under customizer woocommerce section. Or how will I add a field under woocommerce option? Can someone help me with that?
0
votes
1answer
25 views

“Display Site Title and Tagline” checkbox without adding Header Image option

I'm building theme from scratch. I want to add "Display Site Title and Tagline" checkbox bellow Site Title and Tagline I can do that If I add the following code to functions.php add_theme_support( '...
0
votes
1answer
29 views

Wordpress customizer header image section missing [closed]

I made some changes to the theme and reverted it back but now the header is not displaying and the header image section is missing. I even tried switching the theme but sill no header. I tried ...
0
votes
0answers
7 views

Custom Customizer Image Sanitize fails to update image

I use this custom sanitizer to get the appropriate image size so that anyone using my themes can't mess up and put an 8k image in the website. The code works, but the problem I have is that once the ...
0
votes
0answers
32 views

In 2016 Theme where is the Posts page thumbnail image stored?

We built our new site at a staging URL. We then moved it to the live site and everything works fine -except- for the 'Posts' page. On that page, the image specified as the thumbnail continues to ...
0
votes
2answers
16 views

I need to get the control choices to sanitize_callback

Code Currently, I'm working project to automatically generate all my theme customizer options with simple array. 'nav_font_style' => array( 'default_options' => array( 1 ...
2
votes
2answers
50 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 ...
0
votes
0answers
11 views

How do I change the location of Customizer control on the screen?

I have an existing Customizer admin page with several controls already added to it by my theme (screenshot). I want to add my own control and insert it somewhere in the middle of my theme's controls. ...
0
votes
0answers
14 views

Ignoring x-frame-options in Customizer?

I get this error/info in the console on my site when I go to the Customizer. Content Security Policy: Ignoring ‘x-frame-options’ based on ‘frame-ancestors’ directive. I don't understand why this ...
0
votes
0answers
18 views

How can I add a logo to the hamburger menu?

I have a mobile hamburger menu setup, but I am having trouble adding my logo to the left of it. This is coded to go against the theme. Any idea on how I can add a clickable logo to the left of the ...
0
votes
1answer
29 views

Creating default object from empty value in wp_customize?

I have the following code on line 315 and 316 of my theme file customizer.php For some reason I get error in my error_log file in the root of the installation. Everything seems to work fine though. $...
0
votes
0answers
17 views

How to select a particular post layout across theme?

I have multiple layouts which are being used in the theme. Now, I require different excerpt length for every layout. I tried using the excerpt_length filter in functions.php but it affects the excerpt ...
3
votes
1answer
80 views

How to print the value of a custom control in the Customizer?

To the Customizer section of my WordPress admin area, I have added a custom setting and custom control. I would like to now print the value of this control. How can I do this? The code used to add ...
1
vote
1answer
28 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( !...
2
votes
0answers
15 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 ...
0
votes
1answer
19 views

How do I remove header/page-title image in farvis theme? [closed]

I'm working with farvis theme. In that theme I removed background image in customize >> page titles & Breadcrumbs >> background image >> remove. But after I clicked save and reloaded the site ...
0
votes
1answer
20 views

Allow user to choose header style

I am working on developing a simple WP theme that our office will use as a starting point for any future projects that come in. My question is this: How would I go about adding functionality that ...
0
votes
2answers
54 views

How to show Custom Field Value in Woocommerce Shop Page

remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title',10); add_action('woocommerce_shop_loop_item_title','fun',10); function fun() { echo 'custom_field_value'; } ...
0
votes
0answers
11 views

Get current active section and its controls - WordPress, Customizer, JS API

I have a button (custom control) within a section, which on click must get all controls in the section. This is the click event for the button: wp.customize.control( 'reset_control', function( ...
0
votes
0answers
15 views

postMessage callback from Customizer?

I use transport postMessage on my custom customizer settings. This works really good, but I am looking for a way to detect when the postMessage has been called. Right now I change a setting, and the ...
0
votes
1answer
20 views

Wordpress Theme Customization error

On customizing Newspaper theme in Wordpress the page stops loading. Following errors can be seen in the console. I disabled all the plugins to check if it's a problem with any of them. But still, ...
0
votes
0answers
23 views

Checkbox in wordpress customizer not saving and not outputting data

i am building a checkbox in custom plugin. i want to use that checkbox for loading style. so if user check the checkbox this function load_you(); should run and should get checked. but when i do this ...
1
vote
1answer
35 views

How do I get current page ID in Wordpress customizer file?

I'm trying to hide or show customizer settings based on what page I am viewing similar to active_callback' => 'is_front_page', however, I haven't found a way how to access the current page ID from ...
0
votes
0answers
9 views

Javascript when Customizer preview is ready/refreshed?

I am trying to create a javascript which fires everytime the preview iframe is refreshed. I have found this one: wp.customize.bind('ready', function () { }); But this only works when the Customizer ...
0
votes
0answers
19 views

Any hooks before/after each control is rendered

I am looking to extend Customizer to introduce a concept of setting "groups". This is to style them with a background and wrap theme in a fieldset but also to show/hide a whole group. What this means ...
0
votes
0answers
8 views

Customizer input focused, change CSS in preview

I have created a javascript function which changes the css inside the preview when a input is focuses, this means I can bring up a modal when a text input is in focus. This works but as soon as I ...
0
votes
1answer
13 views

Remove button from page if viewed through Customizer

Is it possible to remove a specific button from the page only if it is viewed from the Customizer? I did try a check for wp-customizer in body, but this only checks the body of the iframe and not the ...
0
votes
0answers
14 views

Ajax javascript in Customizer only runs once?

I have a Ajax Javascript/jQuery function which refreshes the content of a div every 5 seconds. This works fantastically when the page is viewed from the front end. When viewing the same page in ...
2
votes
2answers
42 views

wordpress custom theme import and export options for sample data [closed]

I am Created WordPress custom theme as per Html template. it was worked fine. now I am trying to create custom export/import functionality for my custom created theme. but I don't have found a better ...
0
votes
0answers
28 views

Use Customizer value in frontend?

I have created a custom Customizer section called checkin and with an option called title which is a text field. I have created this function function get_checkin_title() { $opts = get_theme_mod(...
0
votes
1answer
31 views

wp_head makes my custom page template not work in Customizer?

I have a weird issue where if I am in the Customizer and visit a page which uses a custom page template I made it doesn't load the site in the preview. But I can see that it loads in the console. I ...
0
votes
0answers
18 views

Customizer clicking section, navigate to different URL?

I found this code https://make.xwp.co/2016/07/21/navigating-to-a-url-in-the-customizer-preview-when-a-section-is-expanded/ which explains how to do this. But for some reason it doesn't work for me. ...
0
votes
1answer
27 views

Trigger Customizer Publish (save) Action

Is there any way to trigger the Customizer's Publish button in javascript? The use-case is to create a secondary save button within a section.
0
votes
1answer
135 views

Hide Theme options and Customize Admin menu

Under the appearance admin menu, I have customizer added by the theme, and theme options added by a plugin. I'm using this code to hide both menus ( submenu's of Appearance )for ALL admins apart from ...
1
vote
0answers
12 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 ...
0
votes
0answers
10 views

No favicon in Customizer?

For some reason my sites favicon isn't visible when I am in the Customizer in Wordpress. Is it possible to have the favicon show up here too? Thank you!
0
votes
1answer
14 views

Remove specific javascript when viewing page in Customizer?

I have a javascript which reloads the page when content change is detected. This is the behaviour I want on the main site. But when I use the Wordpress Customizer I don't want this behaviour as it ...
0
votes
1answer
32 views

Count top level menu items

I need to get count of top level menu items. I have menu with 5 items and of of them has 1 submenu. This is current situation, but the user using the theme I am building may have some different ...
0
votes
1answer
26 views

Edit style.css via theme customizer

Till now in my Wordpress themes, I was implementing few necessary styling options in theme customizer which would edit the CSS and override it by outputting that CSS to head inside <style> tags, ...
-2
votes
1answer
65 views

Refresh Customize Section (not preview)

I am building controls (a) that are generated using a value from a control (b) in another section. However, unless the full customize page is refreshed then then there doesn’t seem to be a way to ...
0
votes
1answer
12 views

Customizer add query to preview URL

In some part of our customizer we are redirecting users to some specific pages. var url = 'https://test.com/specific-page'; api.previewer.previewUrl.set( url ); We want to pass a custom query along ...
0
votes
0answers
27 views

WordPress panel is not loading after plugin activated with error: HTTP ERROR 500

when i try to activate Yoast Seo Plugin, my WordPress panel stop loading and the browser displays: HTTP ERROR 500. I checked my error_log file and there was this error: call_user_func_array() expects ...