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

SIte logo is not displaying

the_custom_logo() displays a custom logo image, linked to home, so you don’t need to echo it, wrap it inside a tag or use it as a src for an image.

If you want to use the default output, then just use in your theme file. If there’s no custom logo set, then the function results in an empty string i.e. nothing is displayed.

For custom output, first get the custom logo image ID with get_theme_mod( 'custom_logo' ) and then get the image markup with wp_get_attachment_image(). Or the logo image url with wp_get_attachment_url() or wp_get_attachment_image_src.

Example with fallback, modified from how get_custom_logo() works.

$custom_logo_id = get_theme_mod( 'custom_logo' );
if ( $custom_logo_id ) {
  $custom_logo_attr = array(
    'class' => 'custom-logo',
  );
  printf(
    '<a href="https://wordpress.stackexchange.com/questions/355609/%1$s" class="custom-logo-link" rel="home">%2$s</a>',
    esc_url( home_url( "https://wordpress.stackexchange.com/" ) ),
    wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr );
  );
} else {
  $custom_logo_attr = array(
    'class' => 'fallback-logo',
  );
  printf(
    '<a href="https://wordpress.stackexchange.com/questions/355609/%1$s" class="custom-logo-link" rel="home">%2$s</a>',
    esc_url( home_url( "https://wordpress.stackexchange.com/" ) ),
    get_template_directory_uri() . '/assets/images/logo.png'
  );
}

Related Posts:

  1. How to add CSS class to custom logo?
  2. How to insert a logo in the header?
  3. How to change get_custom_logo() url?
  4. What flex-width/height does?
  5. No Appearance –> Header menu
  6. WordPress navbar with logo in middle [closed]
  7. Adding a second logo next to the main one in header
  8. Alt header logo and link for specific pages
  9. Menu items description? Custom Walker for wp_nav_menu()
  10. How to define and link full path to css located at a random folder on header.php
  11. Sizing screenshot.png without losing aspect ratio
  12. Software for WordPress Theme and Plugin Development? [closed]
  13. When to use is_home() vs is_front_page()?
  14. What is the preferred way to add custom javascript files to the site?
  15. Get the blog page URL set in Options
  16. How to create .pot files with POedit?
  17. How do I get the theme URL in PHP?
  18. Why when I submit a form in wordpress it loads a 404 page though URL is correct
  19. What is the constant WP_USE_THEMES for?
  20. Worthwhile to restrict direct access of theme files?
  21. How Do I Protect My Premium WordPress App Theme from Copying?
  22. How to detect mobile devices and present them a specific theme?
  23. Using wp_add_inline_style without a stylesheet
  24. How to add posts to custom menus?
  25. WordPress Theme Preview Image
  26. How To extend WP_Customize_Control
  27. What is the difference between front-page.php and home.php? [duplicate]
  28. How can I get page slug
  29. Does the functions.php file ever get called during an AJAX call? Debug AJAX
  30. When to use _e and __ for the translation?
  31. What is a Theme textdomain?
  32. How to show a custom meta box on the “Quick Edit” screen?
  33. How to add custom css file in theme?
  34. How important is it to enqueue a theme’s stylesheet?
  35. CSS not updating in browser when I change it
  36. Display Search Result Count
  37. wp_nav_menu(), how to change class?
  38. theme path in javascript file
  39. Is wp_is_mobile() effective?
  40. Display Menu Name using wp_nav_menu
  41. Making update notification functionality for my themes
  42. What questions do you ask when asked to give an estimate on theme development?
  43. How to remove dashicons.min.css from frontend?
  44. How do I remove a pre-existing customizer setting?
  45. Minimum Template Files for Theme Development
  46. What’s the difference between home.php and index.php?
  47. pass object/JSON to wp_localize_script
  48. get_template_part vs action hooks in themes
  49. Theme Activate Hook
  50. Solutions for generating dynamic javascript / CSS
  51. wp_redirect() – headers already sent
  52. Can I create my own “Recent Posts” widget or customize the existing one?
  53. Custom single template for a specific category
  54. how can I add an icon/image for a child theme?
  55. How can I add a URL field to the attachments window?
  56. The the_post_thumbnail without srcset?
  57. The proper way to include/require PHP files in WordPress
  58. Get the first image from post content (eg.: hotlinked images)
  59. after_setup_theme always runs
  60. When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
  61. Getting failure when using filemtime() with wp_enqueue_style
  62. Do I actually need to link my theme’s style.css in the theme files
  63. Why is wp_head() creating a top margin at the top of my theme header?
  64. How to store widget fields data as an array?
  65. How do I add version control to my workflow?
  66. Using classes instead of global functions in functions.php
  67. WordPress API Menu/Submenu Order
  68. How can I display a menu on certain pages only?
  69. Enqueue a stylesheet for login page and make it appear in head element
  70. Adding a div to wrap widget content after the widget title
  71. How to set permalink structure via functions.php
  72. What is $post_id? is it a global variable in WordPress?
  73. How to override pluggable function in theme?
  74. How to move page template files like page-{slug}.php to a sub-directory?
  75. WooCommerce shop page to use my custom template [closed]
  76. Theme customizer – settings order
  77. What is the difference between wp_register_sidebar_widget and register_widget?
  78. Should we use get_template_part() in functions files instead of include_once?
  79. Reset positions of metaboxes in admin
  80. CSS classes for theme
  81. “Quick Edit” > update clears out my custom meta values
  82. How to enqueue script if widget is displayed on page?
  83. Custom Image section in Customizer
  84. A way to automatically install pages on theme install?
  85. Get entered value of customiser field for live preview
  86. Add custom classes to anchor in wp_nav_menu
  87. How to remove search bar from a wordpress theme? [closed]
  88. Upgrade from 5.0.4 to 5.1.1 causes $theme to be null
  89. Bestway To Define Theme and Plugin path and url
  90. Is there a has_more_tag() method or equivalent?
  91. With WordPress themes, where do I store the images and files relatively?
  92. Form to Add Posts to Custom Post Type
  93. What are the advantages and disadvantages of Option Tree over the Customization API?
  94. Should `get_template_directory_uri()` be escaped?
  95. How do I add settings to the Background Options Page?
  96. Can a theme be built in React?
  97. Best practices for monitoring the need for future updates on a theme that I developed?
  98. Get url of thumbnail from the media uploader
  99. Are content.php and content-single.php the same?
  100. My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
Categories theme-development Tags logo, theme-development
Gutenberg Custom Style problem with background image
Discount in the specific product title using keyword ( Woocoommerce )

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