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
- Cleaning up WordPress to improve performance?
- Proper use of Output Buffer
- Include a external PHP file into a WordPress Custom Template
- How to draw media details for Isotope gallery using Photoswipe
- How to remove hardcoded characters from playlists?
- function_exists call in function.php
- Debugging an error: wp_enqueue_style was called incorrectly
- 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
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- delete an array element when its date expires
- Understanding WordPress child theme custom JS loading
- 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
- Can I change a variable in a content part while calling it?
- 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
- Can’t load WP function into external function
- Set WordPress Default Template
- How to get specific image in media library with php
- Customizer: Output default value in Customizer CSS
- How to remove the cufon script from Dzonia Lite theme [closed]
- How to check if a meta value has already been assigned to any user?
- 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
- Populate editor with some content of a page with a page template
- 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?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- WordPress admin-ajax.php
- How to call multiple functions from multiple files into a WordPress page template [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- get_template_directory adding FTP root folders in urls
- What is the best way to define constant options for a theme?
- List post by title length
- How do i wrap woocomerce attribute in list?
- get_page_templates only return templates with “home” in the filename
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Extract and display user infromation on an automatically created page
- Show different website layout if no sidebar added
- How can I assign separate stylesheets to different pages?
- Need advice on theme customizer and child themes
- How to make sure relative URL works when site is not on root domain?
- Convert all uploaded PNG files to PNG-8 format
- WP insert post Redirect after function has executed
- Displaying images outside the content
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- WP-Bakery – Add custom colors to buttons with template colors
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Retrieve alt text by referencing the img src
- Trying to update Woocommerce meta values
- How to use data URL in WordPress?
- How can I prevent a shortcode div from extending beyond its boundaries?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Delete post meta by serialized meta value
- Menu to the right of screen on desktop using Bootstrap 4
- Automatically refresh page if widget is added to page?
- Get the image title and alt from custom query
- Theme editing “post thumbnail” help
- Retrieving specific images from Media Library
- Calling PHP function doesn’t work in index.php
- 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?
- Select area and checkbox data is not saving?
- I need a button to appear when not loged in and another when logged in, I need help fixing code PLEASE!
- Load slideshow.css file only if Slideshow is checked / on
- add if statement to the featured image
- Remove default Image Sizes
- WP Custom tables query
- Understanding responsive imagery
- WooCommerce: write featured image dimensions to custom fields in product’
- Generate and upload screenshot as featured image for user-submitted post