As what I’ve commented, the rawurlencode()
function is the reason because WordPress have a lot of restrictions. I found that, that kind of problem will exist if you have a %
percent sign (in my case, produced by the rawurlencode()
) in your 'default' => $value
.
One of the solutions, encode some or the whole part of your path with base64_encode()
:
$encode = get_template_directory_uri().'/images/'.get_bloginfo('name').'.gif';
...
'default' => $encode,
...
And later decode it with base64_decode()
before you use it:
$decode = base64_decode(get_theme_mod('themename_img'));
Related Posts:
- Function to return true if current page has child pages
- List of all theme customizer control types?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Redirect to another page using contact form 7? [closed]
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Is there a hack for using is_page() within the function.php file?
- Where can I find the declaration of `$_wp_theme_features`?
- How do I routinely extract the thumbnail of the most recent post?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Save the outputted image into the Media Library, with a different filename and extension
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- Why have on every line
- How do I change/modify the_post_thumbnail(); html output?
- Cleaning up WordPress to improve performance?
- Proper use of Output Buffer
- Include a external PHP file into a WordPress Custom Template
- How to add a class to the attachment images
- Need help setting default setting value for radio button in theme customizer
- Get author full name
- How to draw media details for Isotope gallery using Photoswipe
- How to remove hardcoded characters from playlists?
- function_exists call in function.php
- How to register images uploaded via FTP in media library?
- How to preserve PHP modifications while upgrading WordPress?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Debugging an error: wp_enqueue_style was called incorrectly
- How to get the registered sidebar’s name by its id?
- is there a simple way to list every templates / php files used to generate a specific page?
- Dynamically change feature image in customiser
- One button to change all settings in theme customizer?
- Change comments form title on a page by page basis
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Add custom image sizes to media uploader
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Setting up the child theme so as to enable right-to-left WordPress?
- Design view breaking on Pages
- delete an array element when its date expires
- Understanding WordPress child theme custom JS loading
- How can I loop into two different DIVS without repeating the DIVs
- Removing unnecessary wordpress files
- How to add default images into theme customizer image control?
- Remove css styles from specific page
- Is the regular ajax request method safe or I should use admin-ajax.php?
- How to get custom image size for image uploaded in Customizer
- Overriding a theme redux file in child theme
- Widgets not showing in my custom theme
- Using wp_get_image_editor in a standalone script
- How do I list the_tags() into HTML data-attribute
- Can I change a variable in a content part while calling it?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Change logo based on incoming domain
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- How to break down importing of feeds
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- What is the fastest way to load PHP functions that are only used in one theme template?
- My Own layout in WooCommerce pages [closed]
- Differences when using the the_time and the_date functions
- PHP can I add line numbers to file_get_contents()
- Convert all images to PNG on file upload
- Can’t load WP function into external function
- Displaying theme options in css
- Set WordPress Default Template
- How to get specific image in media library with php
- Setting custom canonical urls
- Trigger popup in a php if/else statement
- Customizer: Output default value in Customizer CSS
- Set the background to a default image if there isn’t a specified “featured image”
- How to remove the cufon script from Dzonia Lite theme [closed]
- How to control WordPress image metadata (using Imagick)?
- How do I add custom bulk actions to multiple custom post types?
- How to check if a meta value has already been assigned to any user?
- what is the best practice to add new field to an api route
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to pick the default selected value in wordpress dropdown?
- Error in custom php function doesn’t exist
- Customizer: active_callback and sanitize_callback incompatibility?
- Populate editor with some content of a page with a page template
- Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
- Menu jumping when calling it via PHP
- Modify custom field input data before creating a new post
- Scrape external webpage for first image and add it to new post
- Skt full width basic slideshow problem
- How to disable controls in theme customizer?
- How do I link a button I created in theme customizer to a function?
- Trying to retrieve post meta
- Need help enqueueing webfonts
- Display tab title as ‘blog tagline | blog title’
- WordPress get_post_meta issue
- Check if values exists DB
- How can I clear the theme mod settings?
- Adding code to the function file
- Display a list of users with avatar filterable with alphabets
- Adding php within a return statement [closed]
- Select area and checkbox data is not saving?