Custom Header Links

:discourse2: Summary Custom Header Links allows you to easily add custom text-based links to the header.
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link GitHub - discourse/discourse-custom-header-links · GitHub
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component


Features

Desktop

Mobile


(due to very limited space, adding more than one link on mobile is not recommended)


Settings

Setting Description
custom_header_links The structured list of links to display in the header. Each link is configured through a form with individual fields (see below).
links_position Controls whether links appear on the right (default) or left side of the header near the logo. When set to left, all links are automatically hidden on topic pages to make room for the topic title — regardless of individual link hide_on_scroll settings.

Adding Links

Links are configured through a structured form in the theme component settings. Click Add to add a new link. Each link has the following fields:

Field Required Description
Text :white_check_mark: Yes The visible label for the link. Max 100 characters. Also determines the CSS class applied to the link (see CSS Customisation below).
Title :x: No The tooltip text shown when hovering over the link. Max 1000 characters.
URL :white_check_mark: Yes The URL the link points to. Can be a relative path (e.g. /faq) or a full URL. Max 2048 characters.
View :x: No Controls which device the link appears on. If left unset, the link shows on all devices (same as vdm). See values below.
Target :x: No Controls how the link opens. If left unset, defaults to opening in a new tab (same as blank). See values below.
Hide on scroll :x: No Controls whether the link hides when the topic title becomes visible in the header on topic pages. Defaults to keep. Only applies when links_position is set to right — see note below. See values below.
Locale :x: No If set, the link is only shown when the site’s page language matches this value. Leave blank to show the link on all locales. See details below.

View values:

Value Behaviour
vdm Visible on both desktop and mobile
vdo Visible on desktop only
vmo Visible on mobile only
(unset) Same as vdm — visible on all devices

Target values:

Value Behaviour
blank Opens in a new tab
self Opens in the same tab
(unset) Defaults to opening in a new tab (same as blank)

Hide on scroll values:

Value Behaviour
keep Link stays visible even when the topic title is shown in the header (default)
remove Link hides when the topic title becomes visible on topic pages

:information_source: hide_on_scroll only applies when links_position is right. When links_position is left, all links are hidden together on topic pages regardless of their individual hide_on_scroll setting.

Here’s an example of hide_on_scroll in action (with links_position set to right):

Most Liked and Privacy are set to keep, so they remain visible when the title expands. The other links are set to remove, so they hide when the title becomes visible. This behaviour only affects topic pages.


Locale Filtering

The Locale field allows you to show a link only when the site is set to a specific language. This is useful for multilingual communities that want different header links per language.

  • Set the field to a locale code such as en, de, fr, zh_CN, etc.
  • The match is case-insensitive, and both - and _ separators are treated identically — so en-US, en_US, and en_us all match equally.
  • If the locale field is left blank, the link shows on all locales. This is the recommended setting for most single-language sites.
  • A CSS class headerLink--{locale} is also added to the link element, which can be used for additional CSS targeting.

:warning: Common issue: If your links are not appearing, check whether you have accidentally set a locale value that does not match your site’s configured language. Leaving the locale field blank is safe and will always show the link.


CSS Customisation

Each link automatically receives a CSS class derived from its Text value: spaces are replaced with hyphens, the text is lowercased, and -custom-header-links is appended.

For example:

  • A link with text Privacy gets the class privacy-custom-header-links
  • A link with text Visit Shop gets the class visit-shop-custom-header-links

Style all header links:

.custom-header-links .headerLink a {
  font-size: var(--font-up-1);
  color: var(--header_primary);
}

Style a specific link (e.g. a link with text “Privacy”):

.custom-header-links .headerLink.privacy-custom-header-links a {
  color: var(--tertiary);
}
.custom-header-links .headerLink.privacy-custom-header-links a:hover {
  color: var(--tertiary-high);
}

Show or hide a link based on login state:

Discourse adds an anon class to the <html> tag for logged-out users. You can use this to conditionally show or hide links:

/* Hide "Dashboard" from logged-out users */
html.anon .dashboard-custom-header-links {
  display: none;
}

/* Hide "Sign Up" from logged-in users */
html:not(.anon) .sign-up-custom-header-links {
  display: none;
}

:warning: CSS display: none is a visual-only hiding mechanism. The link’s HTML is still present in the page source. Do not use this to protect sensitive or access-controlled URLs.

Reorder links with CSS (using flexbox order):

.custom-header-links li {
  &:nth-child(1) { order: 3; }
  &:nth-child(2) { order: 1; }
  &:nth-child(3) { order: 2; }
}

Use the /my path for user-specific links, to avoid hardcoding a username:

/my/messages     → the current user's inbox
/my/activity     → the current user's activity

:discourse2: Hosted by us? Theme components are available to use on our Pro, Business, and Enterprise plans.


Changelog highlights:

  • The custom_header_links setting was migrated from a comma-delimited list format to a structured type: objects form UI. If you previously configured links using the old comma-separated text input, the migration should have preserved your data automatically

Last edited by @Moin 2026-03-23T22:46:59Z

Last checked by @MarkDoerr 2026-03-23T22:39:09Z

Check documentPerform check on document:
84개의 좋아요
How can I add custom hamburger menu
Header Submenus
Control CSS based on user's logged in state
Display StatusPage status on as a header link
Add secondary url / embed into Wordpress
"An empty string is not a valid JSON string" when updating theme component #2
Showing categories statically above most recent posts
How to add a button to the header area?
Looking for a freelancer to implement a custom Discourse theme (based on an existing mockup)
Add a global header between Discourse & Website
How to make custom setting type
Is it possible to have users' job titles next to their names on posts?
Link to find all deleted posts by all users in a particular period
Dropdown links in existing Header
Insert Link to External Website
Is anyone here using their Discourse instance as their entire website?
How to fire on every footer load (or page load?)
Custom links above header bar
Custom Header Links (icons)
Pre seeded posts all missing - Missing Terms of Service, FAQ and Privacy pages
Dropdown header links in the existing Header
Add a "curated personal learning" page for users
Redirect search icon to search page
Possible to change main logo URL?
2021: The Year in Review
How to add breadcrumb?
How to add contact us page?
Navigation bar above all post
Adding link to blog on main page
Customizing your site with existing theme components
Show "new topic" when not logged in
How can I add a new button to the topbar?
⬇️ Dropdown Header
How to fix logo size?
Links into the header block
Customize the header with links, icons, or menus
Privacy Policy does't meet Google's requirements
Custom Header Links and New Topic Header Button don't play nice
Customize Your Site Branding
Nextcloud support
How to override the site-header.hbs file from custom theme?
Sidebar link / top button to PM admin
Toolbar under site header per category
Privacy Policy does't meet Google's requirements
Link buttons on the top disappear when scrolling around the site
Disclaimer section on the "about" page
What Themes are being used for these Discourse forums?
Alternative component (plugin?) to categories navbar
Add button in header for logged in users
Use decorateWidget to add text link to header
[PAID] Expert Wanted for Forum Redesign
Add social media handles on home page
Create hyperlink from home logo
Configure a custom sidebar link to open in a new tab
2023: The Year in Review
Modifying Header
Visiting /admin/upgrade may lead to a server error
Header Submenus
How do I go about making a very customized theme?
How to Integrate a Custom Plugin in discourse UI
Embedding a whole Discourse forum on another site in an <iframe>
Custom website header with forum
Custom Header Links (icons)
Brave default Theme
Why does the logo navigate to Discourse home not main site home
Structuring a multilingual community
How to make sidebar sticky?
Forum navbar is repeating
Adding my Nav into the header bar
Adding a header link for Guests Only
Allow non-members to pm the administrator
Best place(s) to link back to a non-forum homepage?
Memberstack + Webflow + Discourse OpenID Connect
Structuring a multilingual community
External header links are not opening in a new tab
How can I add a button to the header?
Fully Theme
Link on Top header to Go to Home page of main site
How to finely scroll out custom header?
Can I add a icon and link back to my homesite at the top bar
Custom Header links was automatically hide when scrolling topic page contents
Link behavior inconsistent
Upcoming Header Changes - Preparing Themes and Plugins
How to add a "button" which composes a pre-filled topic
Where to place project external URL?
Change destination of logo link
How to split the forum into two main parts (general/groups) and how to display only subcategories I can create a new post in?

이전에 이런 제안이 있었는지 모르겠어요. 다시 읽어봤는데 찾을 수가 없었거든요.

혹시 "서브 링크"를 생성할 수 있는 기능을 추가하면, 편집 가능한 목록(텍스트 색상, 배경 호버 등)을 만들어 줌으로써 줌(Zoom)과 유사한 결과를 얻을 수 있지 않을까 하는 생각이 들었습니다.

8개의 좋아요

오른쪽으로 화살표가 있는 링크, 예를 들어 ‘developer’ 같은 링크는 '하위 링크’가 있다는 뜻입니다.

1개의 좋아요

어떤 항목에 기본적인 드롭다운 메뉴를 추가할 수 있을까요?

"Custom header links"를 사용하여 드롭다운 메뉴를 만들 수 없었습니다. Zoom에서 그렇게 한 것 같습니다. 콘솔을 통해 그들의 드롭다운 메뉴를 확인해 보았지만, 이 컴포넌트의 HTML에 개입하여 어떤 항목에든 드롭다운을 추가하는 방법을 파악하지 못했습니다.

이 드롭다운을 항목에 추가하는 방법이 있을까요? @Johani

<div id="dropdown">
  <a title="Zoom Developer Documentation" href="https://marketplace.zoom.us/docs" target="_blank">Developer</a>
  <span class="caret"></span>
  <div class="dropdown-content">
    <a title="Zoom API Docs" href="https://marketplace.zoom.us/docs/api-reference/introduction" target="_blank">API</a>
    <a title="Zoom SDK Docs" href="https://marketplace.zoom.us/docs/sdk/native-sdks/introduction" target="_blank">SDK</a>
    <a title="Zoom Developer Blog" href="https://medium.com/zoom-developer-blog" target="_blank">Blog</a>
    <a title="Zoom Developer Changelog" href="https://marketplace.zoom.us/docs/changelog" target="_blank">Changelog</a>
    <a title="Zoom Developer Survey" href="https://docs.google.com/forms/d/e/1FAIpQLSeJPLhNuxjtkxyyV276R8S_nYz99fpMbbS8VWkC8Hwi7-2Byg/viewform" target="_blank">Survey</a>
  </div>
</div>
5개의 좋아요

links position을 "left"로 설정했을 때 링크가 열리지 않는 문제를 겪으신 분이 계신가요?

Screen Shot 2020-11-24 at 4.33.12 PM

Preview에서는 링크가 정상 작동하지만, 테마에 적용하면 작동하지 않습니다.
오른쪽 정렬된 링크는 정상적으로 작동합니다.

1개의 좋아요

안녕하세요! 이걸 만들어 주셔서 감사합니다.
텍스트 링크 앞에 SVG를 추가할 수 있을까요? 가능하다면 어떻게 해야 하나요?

1개의 좋아요

해결책을 찾으셨나요? 저도 같은 해결책을 찾고 있습니다.

6개의 좋아요

제목에서 **formatting code**를 실제 서식으로 변환하는 방법은 무엇인가요? 또한 텍스트 앞에 Font Awesome 아이콘을 사용할 수 있을까요?

2개의 좋아요

특정 사용자 그룹에 대해 링크를 표시하거나 숨길 수 있는 플래그를 추가할 수 있을까요?

3개의 좋아요

이 테마 구성 요소에서 드롭다운 내비게이션을 사용할 수 있는 방법이 있을까요? 즉, 헤더 링크에 마우스를 올렸을 때 그 아래에 하위 항목이 표시되는 방식입니다. 아래 링크에서 볼 수 있듯이 HTML/CSS로 이를 구현할 수 있다는 점은 알고 있습니다:

2개의 좋아요

이 컴포넌트를 만들어 주셔서 감사합니다!
한 가지 질문이자 기능 요청이 있습니다. 특정 그룹에 대해 특정 링크를 표시할 수 있을까요?
예를 들어, 사용자가 customers 그룹에 속해 있으면 고객용 컨트롤 패널로 가는 링크를, workers 그룹에 속해 있으면 다른 패널로 가는 링크를 표시하고 싶습니다.
이 기능은 매우 유용할 것 같습니다.
그룹 이름을 마지막(선택) 매개변수로 사용할 수 있습니다.

2개의 좋아요

이 내용 정말 감사합니다! 다른 배너나 컴포넌트를 이것저것 시도해 본 후에야 발견했는데, 제가 딱 필요로 하는 바로 그거예요!

하나 요청/제안할 게 있습니다. 링크 순서를 변경할 수 있는 기능이 있으면 좋겠습니다. 방금 링크를 여러 개 만들었는데, 맨 위에 하나를 더 추가하고 싶더라고요. 지금은 전부 수동으로 복사해서 붙여넣어야 하는데, 복사하는 동안 다른 항목들이 계속 동기화/업데이트되어서 실제로는 꽤 번거롭습니다.

드래그 앤 드롭이나 위/아래 이동 버튼이 있으면 향후 사용자들(혹은 향후 수정 작업)에게 매우 유용할 것 같습니다.

4개의 좋아요

flex 속성을 사용하므로 몇 줄의 CSS만으로 순서를 매우 쉽게 조작할 수 있습니다.

예:

  • 기본 순서
    image

  • 사용자 정의 순서
    image

CSS 예시:

.custom-header-links li {
  &:nth-child(1) {
    order: 3;
    background: red;
  }

  &:nth-child(2) {
    order: 1;
    background: green;
  }

  &:nth-child(3) {
    order: 2;
    background: yellow;
  }
}
5개의 좋아요

@Nick_Chomey 이 테마 컴포넌트뿐만 아니라 type: list 설정을 사용하는 많은 다른 테마 컴포넌트에서도 이 기능이 필요한 경우가 많았어요. 예전에 기능 요청을 제출할 계획이었지만 완전히 잊고 있었습니다. 다행히도 님이 상기시켜 주셔서 여기 하나 추가했습니다:

3개의 좋아요

@dax 고마워요! 이게 가능할 줄은 몰랐어요!

@keegan 정말 멋져요, 언젠가 추가되길 바라요!

2개의 좋아요

저도 같은 해결책을 찾고 있어요. 어떻게 구현했는지 알아냈나요?
감사합니다!

1개의 좋아요

안녕하세요 @Johani!
정말 멋진 컴포넌트를 만들어 주셔서 감사합니다!

사용자가 로그인한 경우에만 링크가 보이도록 할 수 있을까요?
외부 링크입니다.

1개의 좋아요

안녕하세요 @andreas_can, Meta에 오신 것을 환영합니다 :wave:

이 컴포넌트는 링크의 텍스트를 기반으로 각 링크에 CSS 클래스를 추가합니다. 추가되는 클래스는 링크에 부여한 텍스트와 동일하지만, 공백은 하이픈(-)으로 대체되고 텍스트는 소문자로 설정됩니다. 그리고 문자열의 끝에 -custom-header-links가 붙습니다.

따라서 텍스트가

privacy

인 링크를 추가하면, 해당 링크 요소에는 클래스

privacy-custom-header-links

가 부여됩니다.

링크 텍스트가

Visit Shop

이라면, CSS 클래스는

visit-shop-custom-header-links

가 됩니다.

이제 각 링크에 추가되는 클래스를 아시게 되었습니다. 다시 질문으로 돌아가 보겠습니다.

Discourse는 사용자가 로그인하지 않은 경우 <HTML> 태그에 CSS 클래스를 추가합니다. 해당 클래스는

anon

입니다.

따라서 이를 사용하여 로그인하지 않은 사용자에게 특정 링크를 숨길 수 있습니다. 예를 들어, 텍스트가

Customer Support

인 링크가 있고 로그인하지 않은 사용자에게 표시하고 싶지 않다면,

다음과 같은 CSS를 추가합니다.

.anon {
  .customer-support-custom-header-links {
    display: none;
  }
}

이 CSS는 메인 테마의 common > CSS 탭에 추가합니다.

이렇게 하면 로그인하지 않은 사용자에게 해당 링크가 숨겨집니다.

11개의 좋아요

이렇게 빠르고 꼼꼼하게 답변해 주셔서 감사합니다!
제가 찾던 바로 그 내용이었습니다.

한번 해볼게요 :slightly_smiling_face:

3개의 좋아요

CSS의 display: none;은 링크를 브라우저 렌더링에서만 숨길 뿐, 페이지 소스를 보는 사용자, 웹 크롤러 및 검색 엔진에는 항상 완전히 표시된다는 점을 유의하세요.

3개의 좋아요