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

Need print logo without any ID & class

You can achieve this using the get_custom_logo filter.

add_filter( 'get_custom_logo', 'wpse250683_custom_logo_output' );

function wpse250683_custom_logo_output() {
    $custom_logo_id = get_theme_mod( 'custom_logo' );
    $attachment     = wp_get_attachment_image_src( $custom_logo_id, 'full', false );
    $attachment_url="";
    if ( is_array( $attachment ) )
        $attachment_url = $attachment[0];
    $html = sprintf( '<a href="https://wordpress.stackexchange.com/questions/250683/%1$s"><img src="%2$s" /></a>',
        esc_url( home_url( "https://wordpress.stackexchange.com/" ) ),
        $attachment_url
    );
    return $html;
}

Related Posts:

  1. How to redirect to post if search results only returns one post
  2. How to override admin-bar style
  3. wp_get_attachment_image returns different image size
  4. Passing variables to templates (alternatives to globalizing variables)
  5. Load post with a different template?
  6. How to customize search result page title?
  7. How to fix a theme with page.php Default Template that accidentally deleted?
  8. WordPress Change Post Templates,but not drop down, but Image selection
  9. Using locate-template & shortcodes doesn’t appear to work
  10. Can I use require() function in a template file?
  11. How to set global variables in template page?
  12. Why isn’t is_page_template() adding a body class?
  13. Dequeue script in template isn’t working
  14. Query children and parent title
  15. Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
  16. Adjust which tempalte a page uses with a function?
  17. How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
  18. Changing itemprop from logo to image on custom logo?
  19. Custom logo sizes for multiple logos
  20. Make “sidebar template” the default template for new pages
  21. Retrieve post modified date for specific post by post ID
  22. Attach parent category template to all subcategories
  23. Add class or ID to any WordPress function
  24. How to remove howdy dropdown menu content
  25. How to include local menu based on page id?
  26. How to create function from code?
  27. Display Password Protected external RSS in wordpress template
  28. How to extract the variables out from “add_shortcode” function?
  29. Default Gallery Edit/Template Editable?
  30. How to enable template page only for a post id page
  31. Selective Product Category for Carousel
  32. How to change login labels
  33. Modify a function without editing template
  34. Retrieve tags data in post body
  35. Functions For Calling Specific Elements
  36. Full page template function
  37. wordpress use single ajax in place of multiple ajax requests in a smarter way
  38. Add Element as a Filter to the_content
  39. I have problems with loading javascripts
  40. Pass variable from action back to template
  41. Define PHP variable from a seperate API if statement
  42. Best way to handle lack of titles in microblogging
  43. attachment page template? only show attachments for current post?
  44. Run a jquery script on on a certain template page
  45. How to properly set custom logo size?
  46. How to include any template using Shortcode fuction?
  47. Image loading function not working on archive.php template
  48. Add a field into a shortcode of an extension
  49. Convert multiple logos into the_custom_logo
  50. How can I set the SRC URL of the custom logo image?
  51. Specify multiple categories for custom post template – FATAL ERROR
  52. Using functions.php to include code that’s processed inline
  53. How to make a new function that includes a template
  54. Show admin page, only if function is being used
  55. Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy
  56. Prevent creating multiple image resizes in twentytwelve template
  57. Simplest Way to Build Custom Archives Page?
  58. Display ACF category image on archive and single template files
  59. Render page with specific id from functions.php
  60. How to require a config file in a template and in function.php?
  61. the_date() and the_time() functions display actual date an time instead of published date and time
  62. Load templates, pass arguments, and render output from functions.php
  63. Changing the HTML of notices in WooCommerce [closed]
  64. WP Enqueue Script Error
  65. More than one search results page template for two searches on site
  66. WordPress function with attribute pass to template
  67. Help! Need a different logo on my main page from my other pages
  68. Javascript and Stylesheet in child page
  69. Newest comments first not working
  70. Retrieve a custom form field modified by a filter
  71. us states dropdown function and echo in theme template files
  72. How to pass a variable from a template page to the child theme functions.php
  73. Function the_content
  74. Allow the access over wp-login.php
  75. Shortcode to output get_header not working
  76. How can i hide content if not friend in Buddypress? [closed]
  77. Which template file to edit to edit homepage in Mystile [closed]
  78. Make a PHP file with a function
  79. Creating mixture of shortcodes to use in the visual/text editor
  80. My website is generating weired url parameters of paginated pages
  81. How to store page-{id}.php templates in custom folder
  82. Missing feature image link function
  83. What’s the difference between home_url() and site_url()
  84. Remove “Category:”, “Tag:”, “Author:” from the_archive_title
  85. get_template_directory_uri pointing to parent theme not child theme
  86. How to customize the_archive_title()?
  87. remove empty paragraphs from the_content?
  88. What is the “with_front” rewrite key?
  89. Why use if function_exists?
  90. How to override parent functions in child themes?
  91. wp_enqueue_script was called incorrectly
  92. Add multiple custom fields to the general settings page
  93. Ajax call always returns 0
  94. 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
  95. How long does a deprecated function live in core?
  96. Solution to render Shortcodes in Admin Editor
  97. How to add a data attribute to a WordPress menu item
  98. What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
  99. remove_action on after_setup_theme not working from child theme
  100. plugins_url vs plugin_dir_url
Categories functions Tags functions, logo, templates
Exclude category from shortcode
How to add a class to each individual post?

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