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

Adding a second logo next to the main one in header

Below is some javascript that will hopefully append a new link to the top right hand side of your current logo. You will need to add this script to your theme.

I’ve added comments to explain what I’ve done but feel free to ask me any questions if it’s not clear.

<script>
// Create a div element with class secondary-logo which will contain the secondary link inside.
var secondary_logo_link = document.createElement('div');
secondary_logo_link.className="secondary-logo";

// Add the secondary link (replace https://www.google.com with your desired url) to the new container element. Also adding custom CSS styling to help position/size the new element correctly. 
secondary_logo_link.innerHTML = '<a href="https://www.google.com"></a><style>.logo{ position:relative; }.secondary-logo{position: absolute; top: 0; right: 0; width: 27%; height: 100%; z-index: 1;}.secondary-logo a{height: 100%; width: 100%;}</style>';

//Finally append the new secondary-logo element to both occurances of the logo (header and sticky).
document.getElementsByClassName('logo')[0].appendChild(secondary_logo_link.cloneNode(true));
document.getElementsByClassName('logo')[1].appendChild(secondary_logo_link.cloneNode(true));
</script>

Related Posts:

  1. How to add CSS class to custom logo?
  2. How to insert a logo in the header?
  3. Sizing screenshot.png without losing aspect ratio
  4. How to add custom css file in theme?
  5. theme path in javascript file
  6. get_template_part vs action hooks in themes
  7. The the_post_thumbnail without srcset?
  8. The proper way to include/require PHP files in WordPress
  9. after_setup_theme always runs
  10. Do I actually need to link my theme’s style.css in the theme files
  11. Using classes instead of global functions in functions.php
  12. WordPress API Menu/Submenu Order
  13. How to move page template files like page-{slug}.php to a sub-directory?
  14. CSS classes for theme
  15. Add custom classes to anchor in wp_nav_menu
  16. How to remove search bar from a wordpress theme? [closed]
  17. Should `get_template_directory_uri()` be escaped?
  18. Get url of thumbnail from the media uploader
  19. My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”
  20. How To Add New Option Types To Option Tree?
  21. WP 3.4 – what action/hook is called when theme customisation is saved?
  22. What WP folder can I use to write files to?
  23. Are the WordPress Core CSS styles really all nessesary?
  24. Add a dropdown to theme customizer
  25. Should I use set_transient or update_option?
  26. Why doesn’t default WordPress page view use force_balance_tags?
  27. Page template in two level deep folder
  28. Theme Customizer : how to create multiple-level panel
  29. Why I can’t add a CSS style in this WordPress theme?
  30. Theme file for all pages that are a child of a specific page
  31. Allow Shortcode in Theme Customizer
  32. Where to post/upload the new theme for WordPress theme repository
  33. Setting multiple default background images?
  34. Template for individual post designs
  35. How to make a theme with more than one CSS file?
  36. Is it good to rename theme folder downloaded from WordPress.org?
  37. Best practice way to implement custom sections into a WordPress theme
  38. Editing the custom background CSS
  39. What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?
  40. register_sidebar ignores ‘id’ and ‘class’
  41. How to change get_custom_logo() url?
  42. What, specifically, should be included in theme_name_setup()?
  43. How to get gallery images?
  44. Is it possible to use line break in theme description?
  45. Is the theme customizer slowing down my site?
  46. How can I get wp_head() as a string instead of echoing it?
  47. Display a different theme for not logged-in users
  48. Best practice (forward compatibility) for theme options
  49. Automatic Updates For Private And Commercial Themes?
  50. Add colors to existing color palette without replacing it
  51. Child Theme not loading parent CSS
  52. What can I hook into after_setup_theme?
  53. Where do I find the functions triggered within a hook?
  54. What does “Do not deregister the jquery script in the administration area” mean?
  55. What is the best book to learn how to make themes for wordpress?
  56. Grab the first paragraph of each post
  57. add_image_size is scaling, even though crop is set to true
  58. Use of undefined constant FS_CHMOD_DIR – assumed ‘FS_CHMOD_DIR’
  59. How to show next Post Thumbnail image in WordPress using current post id
  60. Symlink a directory to wp-content/themes
  61. Single Page WordPress Theme – Using page templates
  62. What flex-width/height does?
  63. Pushing updates to your premium theme
  64. Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
  65. Where can I find a good reviewed collection of Twenty Ten child themes?
  66. How to check if post has any tag?
  67. What are WooCommerce starter themes? [closed]
  68. How do I get gallery thumbnail URL and change the default thumbnail size?
  69. Front End Post Submit Form
  70. How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
  71. How do I get a parent theme modification from a child theme?
  72. Removing the default sidebar from admin panel
  73. How do I remove RSS feeds from themes?
  74. Select menu on browser resize
  75. How to disable the gradient and font size internal CSS added by WordPress when using theme.json
  76. add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
  77. Is there an error in get_the_tag_list()?
  78. CSS in child theme not overriding the parent theme [closed]
  79. Example of a theme organization without all the default wp files in root
  80. First post of each category
  81. Can I upload WordPress-react theme in Wp theme repository
  82. how to pull wordpress post comments to a external page
  83. Returning Variables back into a template
  84. Advantages of using instead of wp_enqueue_style()?
  85. Style.css redirects to 404 Page not found
  86. index.php is not loaded for single posts
  87. Which is the simplest theme for WordPress to use it as your base?
  88. Displaying wp menus by name without using theme locations
  89. “Cheatin’ uh?” error message on multple theme directories
  90. How to add dynamic inline style?
  91. Optimal solution to develop a wordpress theme?
  92. new theme permissions don’t allow me to edit
  93. Adding WordPress colorpicker in widget settings
  94. Disable the Custom Internal CSS added by theme.json for Certain Pages
  95. Unwanted blank lines before tag
  96. How to add suggest plugin to theme?
  97. Why use while over if in single wordpress posts?
  98. A theme that follows all the best practices to learn from?
  99. How do I display the “Archives” widget layout (sidebar) in WordPress by ‘year’ then by ‘months’?
  100. get_post() function returns post even if it is trashed
Categories theme-development Tags logo, theme-development, themes
Automatically Log Out UserX when visiting WooCommerceStore
WP Query for all events prior to current date

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