Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Mobile
    • Hosting
    • Openverse ↗︎
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • Developers
    • WordPress.tv ↗︎
  • Community
    • Make WordPress
    • Photo Directory
    • Five for the Future
    • WordCamp ↗︎
    • Meetups ↗︎
    • Job Board ↗︎
  • About
    • About WordPress
    • Showcase
    • Enterprise
    • Gutenberg ↗︎
    • WordPress Swag Store ↗︎
  • Get WordPress
Get WordPress
Menu

Make WordPress Core

  • Tickets
  • Components
  • Handbook
  • Browse Source
  • Trac Timeline
  • Create a New Ticket

Welcome!

The WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this site for general updates, status reports, and the occasional code debate. There’s lots of ways to contribute:

  • Found a bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority.? Create a ticket in the bug tracker.
  • Want to contribute? Get started quickly with tickets marked as good first bugs for new contributors or join a bug scrub. There’s more on the reports page, like patches needing testing, and on feature projects page.
  • Other questions? Here is a detailed handbook for contributors, complete with tutorials.

Communication

Core uses Slack for real-time communication. Contributors live all over the world, so there are discussions happening at all hours of the day.

Core development meetings are every Wednesday at 20:00 UTC in the #core channel on Slack. Anyone can join and participate or listen in!

      Tag Archives: custom-logo

      Konstantin Obenland 5:57 pm on March 10, 2016
      Tags: 4.5 ( 60 ), custom-logo, dev-notes ( 472 )   

      Custom Logo

      New in 4.5 is the ability for users to add a logo to their sites (if their theme has declared support for it). It’s an addition to the Custom HeaderHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. and Custom Background features which themes have to declare support for as well, and works pretty much just like them.

      To register support, a theme would add the following call in a callback to the after_setup_theme action:

      function theme_prefix_setup() {
      	add_theme_support( 'custom-logo' );
      }
      add_action( 'after_setup_theme', 'theme_prefix_setup' );
      

      Theme support for custom logos accepts five parameters, added in an arguments array:

      • height
        (int) Expected logo height in pixels.
        Themes can use built-in image sizes (like thumbnail) or register a custom image size and use that.
      • width
        (int) Expected logo width in pixels.
      • flex-height
        (boolean) Whether to allow for a flexible height.
        Showing the logo in a vertical sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. (like Twenty Fifteen) is a good example for when a flexible height can make sense.
      • flex-width
        (boolean) Whether to allow for a flexible width.
        If a theme has room horizontally, flex-width gives users more freedom in how their logo can be displayed. Example:
        add_theme_support( 'custom-logo', array(
           'height'      => 175,
           'width'       => 400,
           'flex-width' => true,
        ) );
        
      • header-text
        (array) Class name(s) of elements to hide.
        This parameter is only important for (the very few) themes that do not also support hiding the header text in custom headers. Themes can pass an array of class names here for all elements constituting header text that could be replaced by a logo.
        add_theme_support( 'custom-logo', array(
           'header-text' => array( 'site-title', 'site-description' ),
        ) );
        

      Not only will this enable the CustomizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings. control to add a custom logo, it will also add a body class of wp-custom-logo that can be used to style the logo if present. Important: When adding support in your theme, please make sure to test setting a new logo in the customizer with your theme active and in Live Preview. You also want to make sure that the theme has styles in place to accommodate logos that don’t have your custom image size (if you chose to add one), like images that have been uploaded before your theme was activated or updated, since they default to the full size.

      To manage displaying a custom logo in the front-end, these three template tags can be used:

      • get_custom_logo( $blog_id = 0 )
        Returns markup for a custom logo.
      • the_custom_logo( $blog_id = 0 )
        Displays markup for a custom logo.
      • has_custom_logo( $blog_id = 0 )
        Returns a boolean true/false, whether a custom logo is set or not.

      To be able to use the new template tags and maintain backwards compatibility with older versions of WordPress it is recommended to wrap these functions in a function_exists() call, similar to how Twenty Sixteen does it:

      function twentysixteen_the_custom_logo() {
         if ( function_exists( 'the_custom_logo' ) ) {
            the_custom_logo();
         }
      }
      

      The latest two default themes will be updated with support for this brand new feature as soon as WordPress 4.5 ships. Themes that have been using Jetpack’s Site Logo implementation will not need to be updated—Jetpack will do a migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. behind the scenes to work with it out of the box.

      A small under the hood goodie: Custom logos utilizes the Customizer’s brand new Selective Refresh feature, allowing for super fast changes without having to reload the entire preview. It also let’s users shift-click the logo in the preview to open the corresponding customizer section.

      Alert: [EDIT]: As of [37077], Custom Logo does not support the size argument anymore. Specifying the logo size in individual arguments has the advantage of only creating a special image file for the specific logo used (and not every image uploaded), and providing more parity with how Custom HeaderHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. works.

      #4-5, #custom-logo, #dev-notes

          Email Updates

          Enter your email address to subscribe to this blog and receive notifications of new posts by email.

          Join 5,652 other subscribers
          • Recent Updates
          • Recent Comments
          • No Replies

          Current Release

          The current release in progress is WordPress 6.3.

          Planned future releases are listed on the Project Roadmap.

          Feature projects not tied to specific releases can be found on the Features page.

          Regular Chats

          Note: All chats happen on Slack.
          • Weekly Developer Meetings: Wednesday 20:00 UTC in #core
          • About the Dev Chat
          • Agendas | Summaries

          • APAC Triage Sessions Tuesday 5:00 UTC alternating between #core and #core-editor
          • JavaScript Weekly Chat Tuesday 14:00 UTC in #core-js
          • Performance Weekly Chat Tuesday 15:00 UTC in #core-performance
          • Multisite Weekly Chat Tuesday 17:00 UTC in #core-multisite
          • REST API Weekly Chat Thursday 18:00 UTC in #core-restapi
          • Editor Weekly Chat Wednesday 14:00 UTC in #core-editor
          • New Contributors Chat Wednesday 19:00 UTC in #core
          • Images/Media Weekly Chat Thursday 15:00 UTC in #core-media
          • CSS Weekly Chat Thursday 21:00 UTC in #core-css
          • Customize Weekly Chat Monday 19:00 UTC in #core-customize

          See all meetings →

          Recent Posts and Comments

          Team Pledges

          1908 people have pledged time to contribute to Core Team efforts! When looking for help on a project or program, try starting by reaching out to them!

          • About
          • News
          • Hosting
          • Donate
          • Swag
          • Documentation
          • Developers
          • Get Involved
          • Learn
          • Showcase
          • Plugins
          • Themes
          • Patterns
          • WordCamp
          • WordPress.TV
          • BuddyPress
          • bbPress
          • WordPress.com
          • Matt
          • Privacy
          • Public Code
          WordPress.org
          WordPress.org
          • Visit our Facebook page
          • Visit our Twitter account
          • Visit our Instagram account
          • Visit our LinkedIn account
          Code is Poetry
          s
          search
          c
          compose new post
          r
          reply
          e
          edit
          t
          go to top
          j
          go to the next post or comment
          k
          go to the previous post or comment
          o
          toggle comment visibility
          esc
          cancel edit post or comment