# Add A Featured Post Link

**URL:** <https://discuss.write.as/t/add-a-featured-post-link/1904>\
**Category:** Development\
**Created:** [October 9, 2020, 10:18pm UTC](https://discuss.write.as/t/add-a-featured-post-link/1904 "2020-10-09T22:18:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dino](https://discuss.write.as/user_avatar/discuss.write.as/dino/32/645_2.png) [@dino](https://discuss.write.as/u/dino)\
**Post date:** [October 9, 2020, 10:18pm UTC](https://discuss.write.as/t/add-a-featured-post-link/1904/1 "2020-10-09T22:18:56Z")

</div>

This forum won’t let me add more replies to the [Share what you are working on and using!](https://discuss.write.as/t/share-what-you-are-working-on-and-using/401/132) thread, so you guys get a new post.

I’ve been thinking of ways to add a “Featured Post” feature on my sites. This is the easiest idea to implement. Using the Javascript for providing a link to a Random post, you can use the same approach to adding a Featured Post link to your site. You control what post to feature by simply changing the link in your custom Javascript. It will look something like this:

![image](https://discuss.write.as/uploads/default/original/1X/3d387ccf865565ba77cfb427a5ea5aa2c1d53ff1.png)

First create a placeholder post and pin it on your homepage. I created a post titled “🎶 Featured Song 🎶”. Then here is the custom Javascript that I use on my site:

```auto
/* Featured Song Link */
var a = document.querySelector('a[href="https://write.as/now-listening-to/featured-song"]');
if (a) {
  a.setAttribute('href', 'https://nowlisteningto.dinobansigan.com/hate-me-sometimes');
  a.setAttribute('title', 'Featured song for this month');
}
var b = document.querySelector('a[href="/now-listening-to/featured-song"]');
if (b) {
  b.setAttribute('href', 'https://nowlisteningto.dinobansigan.com/hate-me-sometimes');
  b.setAttribute('title', 'Featured song for this month');
}
var c = document.querySelector('a[href="https://nowlisteningto.dinobansigan.com/featured-song"]');
if (c) {
  c.setAttribute('href', 'https://nowlisteningto.dinobansigan.com/hate-me-sometimes');
  c.setAttribute('title', 'Featured song for this month');
}

```

Just remember to change the link to something else every month or every week, or however often you want to.

---

<div class="post-metadata">

**Author:** ![cjeller1592](https://discuss.write.as/user_avatar/discuss.write.as/cjeller1592/32/128_2.png) [@cjeller1592](https://discuss.write.as/u/cjeller1592)\
**Post date:** [October 11, 2020, 3:06pm UTC](https://discuss.write.as/t/add-a-featured-post-link/1904/2 "2020-10-11T15:06:19Z")

</div>

A post was merged into an existing topic: [Share what you are working on and using!](https://discuss.write.as/t/share-what-you-are-working-on-and-using/401)

---

<div class="post-metadata">

**Author:** ![cjeller1592](https://discuss.write.as/user_avatar/discuss.write.as/cjeller1592/32/128_2.png) [@cjeller1592](https://discuss.write.as/u/cjeller1592)\
**Post date:** [October 11, 2020, 3:06pm UTC](https://discuss.write.as/t/add-a-featured-post-link/1904/3 "2020-10-11T15:06:20Z")

</div>


