get_theme_mod is not returning the HTML code for an image and it’s not returning URL of that image. So what is that number? It’s the ID of selected attachment.
This way you can decide how to use the selected value. So how to display the image?
If you want to print the image, you can do this:
if ( get_theme_mod( 'hbps_blog_overlay_logo' ) > 0 ) {
echo wp_get_attachment_image( get_theme_mod( 'hbps_blog_overlay_logo' ), 'full' );
}
And to display only the URL of that file:
if ( get_theme_mod( 'hbps_blog_overlay_logo' ) > 0 ) {
echo wp_get_attachment_image_url( get_theme_mod( 'hbps_blog_overlay_logo' ), 'full' );
}
Related Posts:
- Theme Customization API and child themes
- Theme customizer: How do you grab the value later?
- How can you change default color scheme in a Twenty Fifteen child theme?
- How can I override file featured-image-first.php of Avada theme [closed]
- WP Customizer Fatal Error trying to load class in child theme
- Child Theme disable customizer defaults
- Can I add customizer sections in the Twenty Seventeen theme?
- Child Theme Customizer not working
- How to stop customizer settings inheritance from parent to child theme?
- Child theme customizer preview doesn’t work/load
- How to override JavaScript files in child theme?
- Versioning @import of parent theme’s style.css
- How to add code to Header.php in a child theme?
- Why does my child theme CSS get called twice?
- get_option() vs get_theme_mod(): Why is one slower?
- How do themes provide support for child themes?
- Attributing a version number to a child theme’s main stylesheet
- Preserving theme settings in child theme
- Is it possible to make grandchild themes?
- how do I queue my Child stylesheet/s *after* every Parent stylesheet/statement?
- How to cache bust a child theme style.css
- Is a text-domain necessary for a child theme
- How to modify single.php in a child theme?
- Cannot get Child Theme to load latest version of style.css
- Issues enqueueing parent & child theme stylesheets with revised Codex method
- @package & @subpackage: how to use with child themes
- How to override function in child theme
- Use default value of wp_customizer in theme_mod output?
- Why is the Child Theme Stylesheet Not Loading?
- Hiding Parent Theme
- get_stylesheet_directory() vs get_template_directory() for child theme
- get_parent_theme_file_path vs. get_template_directory
- How to Add Customizer Setting in Child Theme
- Git vs Child Theme
- Can I create customizer setting that can handle plugin shortcode?
- Give priority to child theme stylesheet
- Child theme does not overwrite parent themes style.css
- how to call files in child theme?
- Get Parent Theme Author Name
- Get parent theme version
- Optimal approach for replacing the 8 header images in a child theme?
- How to transfer changes to a child theme?
- WordPress master + child themes + Git workflow
- get_theme_mod doesn’t return the theme customizer preview’s new values in after_setup_theme hook
- How to use parent theme’s enqueue methods
- How do I override a parent theme’s language files with a child theme?
- something like is_childtheme()
- Do all files in child theme override the parent?
- Child theme showing a blank page
- customize_register with Multiple controls/settings – how to get values?
- Child theme preview missing
- Child Theme Performance
- How could child theme be different than parent theme if I haven’t made changes?
- How to solve “Warning: Use of undefined constant” when overriding a parent theme function in the child theme?
- Do I need to update the child theme too after updating the parent?
- get_template_directory vs get_stylesheet_directory
- Developing a childtheme, how to disable the parents templates?
- Under heavy cache conditions, updating the parent theme don’t reflect changes with child theme enabled
- How do I get a parent theme modification from a child theme?
- Why does get_theme_mod return blank (or default value) but get_option returns saved value?
- How to maintain wp_enqueue_style dependencies set in parent theme style enqueuing
- Child Theme, Functions.php Issues
- Redefining function in child themes
- Copy customizer options to child theme
- How do I check for child theme files first using include, before going to parent theme?
- Use admin options from parent theme in child theme
- When activating a child theme, what core settings have to be reset ie; Custom Menus etc?
- Hwo to turn off “get_parent_theme_file_path” in child-theme?
- Overriding parent theme file
- How to “remove” file from parent theme
- How to override the Parent theme Function into child themes functions.php
- How can I make new .css file in child theme override styles in child theme’s style.css
- Why is remove_setting and remove_control not working?
- Enqueue styles properly in a child theme and stylesheets location
- Enqueue more than two CSS styles in a child theme functions.php
- Proper way to make a tweaked theme into child-theme setting?
- Get_theme_mod not retrieving value
- Promoting child theme to stand alone
- How to disable updates in WordPress theme
- Style.css in child theme is loaded before Bootstrap
- Activating child theme returns “active theme is broken”
- Overiding functions.php with child-theme
- How are updates to the style.css file in child theme recognized?
- How do I set up a child-theme without using @import
- Find a Parent Theme’s stylesheet $handle when it registers a stylesheet
- Child theme error “Template is missing”
- Dequeue only stylesheets but not inline style added using wp_add_inline_style
- get_theme_mod not working
- How to change default header image dimensions in twentyfourteen child theme?
- Overwrite CSS with without deleting it
- Adding or modifying in files of parent theme via child’s function.php
- Enqueue stylesheets if parent theme has more than one .css file
- replace parent theme images in child theme
- Website Broken on Activating Child Theme! [closed]
- Using the child theme functions.php to change the customizer.php on parent theme
- Child theme implementation issues
- Can’t override footer.php in child theme
- Child themes & updates?
- Add post dates from child theme and change font size on homepage post
- Crop image from get_theme_mod Customizer field