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
- How to change the color of an svg element?
- D3 Appending Text to a SVG Rectangle
- How to use z-index in svg elements?
- SVG transparent background web
- SVG drop shadow using css3
- How to set text color for my d3 chart title?
- 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?
- 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?
- Cant upload SVG files after updating WordPress 4.7.1 [duplicate]
- How to Include SVG sprites icons into the body tag? [closed]
- Adding custom fields to the header.php
- 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?
- Display different header images based on current page
- How to remove header images from all pages except the home page? skeleton theme
- Replace Home with image link inside custom header menu
- How to change default header image dimensions in twentyfourteen child theme?
- Mysterious HTTP 404 header in my own scripts
- Featured Image .svg height and width 1px only
- Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?
- adding meta data using plugin to top of head
- Header Slideshow [duplicate]
- Create mobile navigation header with settings integration
- Remove elementor header and display default theme header
- How to output php between header and woocommerce container
- My menu bar dissapeared with autooptimize [closed]
- Different banner for different section
- How to change header image size in custom themes
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Additional custom header image
- Insert HTML in post, below nav bar but above content?
- header_image not returning header image url
- How to prevent WordPress to remove my embedded SVG images
- Upload Custom Mime Types in WordPress (SVG, WebP)
- SVG in list-style-image breaks when adding fill
- Are SVG image files safe to upload? Why WP defines them as a security risk? [duplicate]
- Can you change the color of svg icons to the global color I choose from WordPress
- Allow SVG in WP step by step
- Querying a large number of posts including their custom fields data
- Adding other links on header than LinkedIn, Facebook, Youtube etc
- How to set “lang” attribute for post/page title?
- How to change the background color of my header dynamically based on a Custom Posts types color value?
- Page header menu links change
- navigation doesn’t work in custom header.php
- Replace custom SVG icons in Twenty Twenty-One
- Add helper text in custom-header section in admin
- Swap SVG icons in child themes
- Create Gutenburg Block to render inline SVG
- How can I change this SVG shape that’s generated?
- WordPress Block.js SVG createElement
- Expected an identifier and instead saw ‘
- Where is the Javascript attribute window._wpCustomHeaderSettings defined?
- Add a svg and show some text on the parts of that view when the user hover or click on that part in WordPress
- Conditional Site Logo(Category Based)
- Different custom header video on different pages
- Dynamic Title for custom post types
- Display the current post author and his url in the post header
- Trouble with responsivitizing my twentythirteen header
- Set header for default posts page?
- header specific meta box result detect url
- Creating a custom header
- change with CSS the color of an svg background image set with “background-image: url()”
- WordPress search form and input type=”image”
- How can I add a google play badge to my header and footer?
- How to laod wp_enqueue_style to another header i created my self
- How to implement a custom sliding banner? [closed]
- Image is very blurry
- Header and Footer options in pages and posts
- SVG Icon Code Support in WordPress Custom Html Widget? Not Working