I solved it using the second way.
I found out that you have to register the default image also.
So after registering the svg as a default header it displays like it should!
Here is my code:
register_default_headers( array(
'kami-logo' => array(
'url' => get_stylesheet_directory_uri() . '/images/logo.svg',
'thumbnail_url' => get_stylesheet_directory_uri() . '/images/logo.svg',
'description' => __( 'Kami Logo', 'fun' )
)
));
add_theme_support( 'custom-header', array(
'default-image' => get_stylesheet_directory_uri() . '/images/logo.svg',
'width' => 320,
'height' => 320,
'header-selector' => '.site-title a',
'header-text' => false
) );
Related Posts:
- How to edit codes of an individual page/post?
- How to add text to header below title but above nav
- Different Header Files WordPress
- Remove an uploaded header image
- Is there a way of registering a default logo image for custom-logo?
- Want to create Custom Header based on Geo Location
- Add additional upload field to Custom Header page
- Change position of header image with default 2019 theme
- Include different scripts and styles for two separate custom headers?
- Different header image ‘Home’ and Pages
- Add credit to get_custom_header in alt
- Custom page html headings plugin?
- I want to add my website name in wordpress source code like this
- My custom header does not change the header image height and width
- Embed Form In Header
- Include an infogr.am link in header of twenty seventeen theme
- Disable header banner on specific Posts
- How to add custom header to Twenty seventeen single post in wordpress
- Trying to put text and links into a header
- Child theme does not override parent theme values (custom-header)
- WordPress 4.4.2, _s starter theme, problems with custom default header
- Add a wrapper in the header
- How to create a custom header?
- How to display the link that says “Edit Header Image” on header image
- SVG center horizontal and vertical line
- Adding border to SVG image
- How to change the color of an svg element?
- SVG Fill Color Not Working
- D3 Appending Text to a SVG Rectangle
- How to add a tooltip to an svg graphic?
- How to use z-index in svg elements?
- SVG transparent background web
- SVG drop shadow using css3
- How to extract svg as file from web page
- How to set text color for my d3 chart title?
- How do I center an SVG in a div?
- Batch command for ImageMagick to convert all files in a directory and sub-directories on windows
- SVG files not uploading since most recent WP update
- For what security reasons are svgs blocked in the media uploader?
- Ways to handle SVG rendering in wordpress?
- Escaping and sanitizing SVGs in metabox textarea
- How can i get the name parameter defined in get_header?
- How to upload SVG in WordPress 4.9.8?
- Can’t extract and set SVG dimensions
- How to get the custom header image’s alt text?
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- Issue with wp_get_attachment_image() and SVG file type
- Understanding SVG vulnerabilities in WordPress related to a specific fix
- Cant upload SVG files after updating WordPress 4.7.1 [duplicate]
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- Escaping SVG with KSES
- How to Include SVG sprites icons into the body tag? [closed]
- Adding custom fields to the header.php
- getting uploaded SVG dimensions on front-end
- Additional Option on Custom Header admin
- How do I enable the customize theme page to accept svg’s?
- Custom text-only header
- How can I add a custom header to a custom template in a plugin without using the theme folders
- How to Handle CSS for Multiple Header header.php Files?
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Stylizing external SVG files with jQuery and CSS
- Add custom SVG icons to Social Icon MENU in WordPress Twenty Seventeen Child Theme
- Get a sidebar at the top of the page
- add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
- Display different header images based on current page
- use of tag into wordpress
- SVG image upload stopped working
- How to implement my own icons instead of using the svg icon system
- How to remove header images from all pages except the home page? skeleton theme
- Replace Home with image link inside custom header menu
- Set media metadata (i.e. “dimensions” field) on SVG file after extracting it with a filter
- Allowing SVG uploads in media uploader without plug-in
- Different custom header image on different page
- How to change default header image dimensions in twentyfourteen child theme?
- How to change the height of featured image in Twenty Eleven child theme
- How to remove SVG Files inline code of WordPress Footer?
- Custom header images won’t appear when set to random
- Loss of sharpness in jpg imported as header in twentyeleven
- Mysterious HTTP 404 header in my own scripts
- Featured Image .svg height and width 1px only
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?
- Disable automatig SVG tag from menu
- Change location of header.php and footer.php
- How to Edit the style of header title of Twenty Eleven Theme?
- adding meta data using plugin to top of head
- Show Different Header on a Specific Post ID
- Change the location of add_theme_support( ‘custom-header’ ) in the customizer
- add_theme_support(‘custom-header’) does not add the option to customize
- Header Slideshow [duplicate]
- Insert SVG code (not img) in HTML block
- Modify wp-admin page header ‘viewport’ meta data
- SVG Featured image not shown in twitter
- How to insert a Button or custom text on twentyseventeen header
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- Changing custom logo link
- Hide header texts (Title & Tagline) in custom-header.php
- From where the header-text can be changed in WordPress custom header?
- Why I am getting Parse error: syntax error when I use ‘wp_is_mobile’?
- Create mobile navigation header with settings integration