# Headline - code injection?

**URL:** <https://forum.ghost.org/t/headline-code-injection/30916>\
**Category:** Themes\
**Created:** [June 22, 2022, 12:14am UTC](https://forum.ghost.org/t/headline-code-injection/30916 "2022-06-22T00:14:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![katyenka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/katyenka/32/8532_2.png) [@katyenka](https://forum.ghost.org/u/katyenka)\
**Post date:** [June 22, 2022, 12:14am UTC](https://forum.ghost.org/t/headline-code-injection/30916/1 "2022-06-22T00:14:24Z")

</div>

Hi friends! I’m using the Headline theme, which has a file related-posts.hbs that puts related posts at the bottom of a post. The default is a limit of 3 and I want to increase that. I know how to do it by downloading the theme, editing and uploading again, but does anyone know if it’s possible to alter this via code injection instead? This is the full code of the file. Thank you!

 ![Screen Shot 2022-06-21 at 8.14.45 PM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/9/9/9918d848e774ac5b3f69149d1b7b3959bf8d6cf4.png)

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [June 22, 2022, 12:44pm UTC](https://forum.ghost.org/t/headline-code-injection/30916/2 "2022-06-22T12:44:21Z")

</div>

It’s not possible with code injection because what you want to change is part of the templating system.

By the time code injection has a chance to run, the templating phase is complete and only rendered HTML is left.

Customizing the template is the best way.

Is your concern that you would like to maintain your changes while also receiving updates to the Headline theme?

---

<div class="post-metadata">

**Author:** ![katyenka](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/katyenka/32/8532_2.png) [@katyenka](https://forum.ghost.org/u/katyenka)\
**Post date:** [June 22, 2022, 2:03pm UTC](https://forum.ghost.org/t/headline-code-injection/30916/3 "2022-06-22T14:03:50Z")

</div>

Yeah, that’s what I thought. Thanks! And yes, it’s so much easier to just let the updates run themselves. But now I suppose I have a reason to try and fix the multiple authors problem…

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [June 22, 2022, 2:20pm UTC](https://forum.ghost.org/t/headline-code-injection/30916/4 "2022-06-22T14:20:14Z")

</div>

I also want to maintain changes to the Headline theme while also merging in future changes-- I’d like “dark mode” and also to replace the “Latest” section of the home page with a “Featured” section.

Here’s my plan:

1. Checkout the “Themes” repo which contains it, using Git: [GitHub - TryGhost/Themes: A monorepo for Ghost themes](https://github.com/TryGhost/Themes)
2. Create a new branch of the project for my changes in Git, and make my changes there.
3. As new changes are made to the Headline git repo, I’ll rebase my branch on the main branch, effectively re-playing my changes on top of the upstream changes.

---

<div class="post-metadata">

**Author:** ![Leepish](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@Leepish](https://forum.ghost.org/u/Leepish)\
**Post date:** [March 3, 2023, 11:41pm UTC](https://forum.ghost.org/t/headline-code-injection/30916/5 "2023-03-03T23:41:31Z")

</div>

Apologies to relight this thread, but what is the benefit of forking the monorepo rather than the headline repo? I currently fork the headline repo but now wondering if that’s the wrong thing to do

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [March 4, 2023, 3:17am UTC](https://forum.ghost.org/t/headline-code-injection/30916/6 "2023-03-04T03:17:42Z")

</div>

Later I changed my approach and forked the Headline repo instead. My latest post about how I maintain my fork is here:

> **[My Ghost Headline theme fork with dark mode](https://mark.stosberg.com/my-ghost-headline-theme-fork-with-dark-mode/)**
>
> This blog is powered by the free, open source Ghost blogging software.
> 
> 
> Why I like the Headline theme
> 
> For my personal site I wanted a dark mode theme that would work well for writing about a range of unrelated topics. I also go for months without...
