Have a look into set_theme_mod()
:
Creates or updates a modification setting for the current theme
and get_theme_mod()
:
Retrieves a modification setting for the current theme
With this you should be able to get the logo:
$custom_logo_id = get_theme_mod( 'custom_logo' );
$logo = wp_get_attachment_image( $custom_logo_id, 'full' );
This would set the attachment 12 as the logo
$attachment_id = 12;
set_theme_mod( 'custom_logo', $attachment_id );
Hope, this helps 🙂
Related Posts:
- How do I handle the “WP_Customize_Cropped_Image_Control” callback?
- How do I use add_control to offer a list of all pages in the customiser?
- Can i use the same sanitize function on multiple theme mod textboxes?
- Insert content between sections in WP customizer
- Function has_custom_logo when used in Customizer
- Defining path of content folder in WP-config solves the issue of missing header, footer, theme options. Is this a good approach? Expert Advice needed
- In 2016 Theme where is the Posts page thumbnail image stored?
- Exiting Customizer alert
- Why Settings API Options Override Customizer Settings?
- Manipulating customizer panels and fields?
- Issues Saving Long String Option
- get_option() vs get_theme_mod(): Why is one slower?
- Different customizer previewUrls per section
- Add custom background to div in home page
- Make Theme Options Native to Theme Customizer
- Theme option : having the ability to select among several predefined headers
- Can I change a control’s transport in Customizer depending on the previewed page?
- Passing data from customize-controls.js to the customize-preview.js
- Get attachment id from WP Customizer
- How to output WP_Customize_Cropped_Image_Control setting?
- Deactivate sections/panels when the Customizer finishes loading
- How to remove menus section from WordPress theme customizer
- Need to run a plugin on Customize.php
- Customizer preview doesn’t update get_option() value properly
- Set Default Page On Customizer Live Preview
- How to hide few theme customization options – TwentySeventeen theme
- Does the customizer support multiple templates?
- How can a default site icon be set in customizer?
- How to hook CSS file according to theme selection in the customizer section
- New customizer setting not showing value
- Removing pre existing menu item
- Theme customization based on grouped pages
- get_theme_mod() only working when the customizer is open
- Change the location of add_theme_support( ‘custom-header’ ) in the customizer
- Customizer: Update Preview instantly when typing into a number input field
- add_theme_support(‘custom-header’) does not add the option to customize
- Create custom control for WordPress customizer using JavaScript
- Customizer Not Applying Any Change, No Error Thrown
- Need a help on sanitization
- Make customizer controls get custom setting type value
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- How to Get WP_Customize_Image_Control content?
- Selective refresh and registering widget areas
- How to use Vuejs inside a custom control?
- Creating Dependant Text field in Customizer with Checkbox
- Customizer Ajax
- Theme Customizier sanitize_callback not working
- How to disable wordpress from overload my stylesheet styles with customizer styles
- How to enqueue javascript for WP Customize options sidebar?
- Add post type titles in customizer dropdown list
- Change WordPress header color using customizer
- How to make a Customizer partial force full refresh instantly?
- get_theme_mod filter ignores sanitize_callback
- DIVI Theme customizer changes not applied on existing pages [closed]
- Place a message in theme customizer sidebar
- Trouble creating custom sanitization function for user list dropdown
- Output foreach loop used in WordPress wp_customize
- Changing Customizer Select To Checbox, But Retaining Classes
- Override theme style rule in Gutenberg
- How to add custom classes to the customizer panels, sections or controls?
- Theme Check plugin error when I add ‘©’ [closed]
- Theme Customize API Panel Concept
- Detect device change (desktop, tablet or mobile) in Customizer
- Kirki: generate toggles for each taxonomy term
- Custom Customizer setting only saving value of 0
- Allow multiple settings to be stored in a single option in Theme customizer
- How to make WordPress customizer to autoload changes?
- When deleting a theme, are the theme customizer settings also deleted from the database?
- How to Add new Arguments to custom Control of customizer wordpress?
- where to change text for header?
- Theme Customizer for only author.php (per user baisi)
- Customizer API – Class doesn’t exist error
- Get register wp_customize settings in the front end
- Customizer List of Items
- Prevent WordPress from setting src on image added in Customiser
- How would you set Theme Customizer API Previewer Preview URL of a Logged out Page or Login Screen
- Sanitize callback function for select controll in customizer
- Creating a WordPress Customizer control/field with react
- How to save theme customizer values as sub-array?
- In wordpress customizer div still showing even if I hid it with javascript
- Change a customizer control based on another control’s value dynamically
- Linking to a Customizer control
- How to add a link to an external website in the description of a customizer control (with Kirki)?
- Top header to edit page not present in one page
- Using different header images for different devices
- WordPress Customizer not allowing menu options
- Customizer Get Control Choices on Change
- How to implement Selective Refresh within posts?
- Why my first new WP_Customize_Image_Control doesn’t work
- How to customize the colors within a stylesheet using a WordPress setting
- Return customizer setting value in functions.php
- HTML inside Customizer
- Disabling and enabling content using Customizer
- “No Data Received” error in Chrome every time i try to update the theme functions file
- How to rename and rearrange multiple sections in the Customizer?
- How to show associated fields if checkbox is checked in customize widget screen using wp_customize?
- What is a suitable sanitize_callback for logo image in Customizer?
- Remove Astra Customizer Panels [closed]
- How to access files outside /var/www/html