Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Is there a way of registering a default logo image for custom-logo?

No, there isn’t.

Given that a logo is typically unique for each site and brand, it doesn’t really make much sense to offer a default logo, except as a placeholder.

If you want to have a default logo as a placeholder in your theme, then in the template you could check if a custom value is set, and if not, display your own logo:

<?php
if ( get_custom_logo() ) {
    the_custom_logo();
} else {
    printf(
        '<a href="https://wordpress.stackexchange.com/questions/324854/%1$s" class="custom-logo-link" rel="home" itemprop="url"><img src="%2$s" class="custom-logo" itemprop="logo" alt="%3$s"></a>',
        esc_url( home_url( "https://wordpress.stackexchange.com/" ) ),
        esc_url( get_theme_file_uri( 'images/default-logo.png' ) ),
        get_bloginfo( 'name', 'display' )
    );
}
?>

The markup in this example will match the markup output of the_custom_logo(). The logo itself would be default-logo.png in the images/ directory of your theme.

Related Posts:

  1. How to edit codes of an individual page/post?
  2. How to use a svg as custom header?
  3. How to add text to header below title but above nav
  4. Different Header Files WordPress
  5. Remove an uploaded header image
  6. Changing custom logo link
  7. Want to create Custom Header based on Geo Location
  8. Add additional upload field to Custom Header page
  9. Change position of header image with default 2019 theme
  10. Include different scripts and styles for two separate custom headers?
  11. Different header image ‘Home’ and Pages
  12. Add credit to get_custom_header in alt
  13. Custom page html headings plugin?
  14. I want to add my website name in wordpress source code like this
  15. My custom header does not change the header image height and width
  16. Embed Form In Header
  17. Include an infogr.am link in header of twenty seventeen theme
  18. Disable header banner on specific Posts
  19. How to add custom header to Twenty seventeen single post in wordpress
  20. Trying to put text and links into a header
  21. Child theme does not override parent theme values (custom-header)
  22. Conditional Site Logo(Category Based)
  23. WordPress 4.4.2, _s starter theme, problems with custom default header
  24. Add a wrapper in the header
  25. How to create a custom header?
  26. How to display the link that says “Edit Header Image” on header image
  27. How can I add a google play badge to my header and footer?
  28. How to hide or change mobile header logo with Additional CSS or custom PHP
  29. How to add CSS class to custom logo?
  30. How to insert a logo in the header?
  31. How can i get the name parameter defined in get_header?
  32. Custom ID for certain menu item?
  33. How to get the custom header image’s alt text?
  34. When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
  35. Multiple image logo for theme
  36. How to remove the WordPress logo from login and register page?
  37. How to change get_custom_logo() url?
  38. Adding custom fields to the header.php
  39. How do I handle the “WP_Customize_Cropped_Image_Control” callback?
  40. Additional Option on Custom Header admin
  41. Change logo url link
  42. How do I enable the customize theme page to accept svg’s?
  43. Replace admin bar logo
  44. Custom text-only header
  45. What flex-width/height does?
  46. How can I add a custom header to a custom template in a plugin without using the theme folders
  47. How to Handle CSS for Multiple Header header.php Files?
  48. Get a sidebar at the top of the page
  49. add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
  50. Display different header images based on current page
  51. Changing Login Logo
  52. How to remove header images from all pages except the home page? skeleton theme
  53. WordPress login page logo customization
  54. Display a default image for custom-logo
  55. Different custom header image on different page
  56. How to change default header image dimensions in twentyfourteen child theme?
  57. How to change the height of featured image in Twenty Eleven child theme
  58. Custom header images won’t appear when set to random
  59. Changing itemprop from logo to image on custom logo?
  60. Change logo on each page of University Hub theme [closed]
  61. Custom logo sizes for multiple logos
  62. Loss of sharpness in jpg imported as header in twentyeleven
  63. Mysterious HTTP 404 header in my own scripts
  64. Remove Site Logo from Homepage in Twenty Twentyone
  65. What is the advantage of using header-catname.php over is_category(‘catname’);?
  66. Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
  67. Change location of header.php and footer.php
  68. How to remove admin bar logo in WordPress using plugin
  69. How to Edit the style of header title of Twenty Eleven Theme?
  70. No Appearance –> Header menu
  71. WordPress logo upload option in theme panel
  72. adding meta data using plugin to top of head
  73. Show Different Header on a Specific Post ID
  74. Remove link around logo
  75. Change the location of add_theme_support( ‘custom-header’ ) in the customizer
  76. add_theme_support(‘custom-header’) does not add the option to customize
  77. Header Slideshow [duplicate]
  78. How to add an RSS logo to my blogs header?
  79. Add more then one site logo – custom-logo theme support
  80. Modify wp-admin page header ‘viewport’ meta data
  81. WordPress navbar with logo in middle [closed]
  82. How to insert a Button or custom text on twentyseventeen header
  83. Inserting header logo in the bootstrap theme
  84. Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
  85. How to load google font only if custom logo is not uploaded
  86. Hide header texts (Title & Tagline) in custom-header.php
  87. From where the header-text can be changed in WordPress custom header?
  88. Why I am getting Parse error: syntax error when I use ‘wp_is_mobile’?
  89. Theme Options Page – User Updates Logo
  90. Create mobile navigation header with settings integration
  91. How can I use a logo in the header?
  92. Using website header, menu and footer on WordPress blog
  93. Getting $curauth->ID to work inside a shortcode
  94. display dynamic WP Site logo on wp-admin using CSS
  95. Headers Content-Security-Policy CSP Major Issue
  96. Remove elementor header and display default theme header
  97. Get Custom Logo Alt Text
  98. How to change logo url [closed]
  99. Determine what pages are in my header [closed]
  100. How to output php between header and woocommerce container
Categories custom-header Tags custom-header, logo
Display FNumber (aperture) as a number versus a fraction
My custom link works only on home page

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress