Site logo

Archived topic

Affiliate Link Header

3 replies · Started by Arun on February 6, 2023

Viewing posts 1–4 of 4

Hey There, I want to add header for "This post may contain affiliate links. Read out our full disclosure for more info. I tried many of the support forum things but it did'nt work out. can you give me just code so i can put under Hook> Code> and display rule. I also want a different background for that just like this website https://www.dollarfinancials.com/legit-cash-games/ and here are the screenshot of the website. Screenshot of Header

Hi there,

Are you using the block editor?

Let me know :)

No i'm not using block editor and i'm not expert with css or any other language. can you just give me the code as the above website (which one i mentioned) so it will be easy for me to do so.

No i’m not using block editor and i’m not expert with css or any other language.

In that case, I would highly recommend the using the block editor - it's designed for users without any coding knowledge.

The example you've shown is using the block editor as well without any coding.

can you just give me the code as the above website (which one i mentioned) so it will be easy for me to do so.

We normally cannot provide a full HTML and CSS solution as it's not a theme-related request and can be achieved easily with the block editor. However, this one is simple enough I can make an exception.

Here is the HTML content:
<div class="affiliate-message"><em>This post may contain affiliate links. Please read our <a href="https://URL here" target="_blank">disclosure</a> for more info.</em></div>

And here is the CSS:

.affiliate-message {
    padding: 20px;
    background-color: #2222;
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Choose the hook generate_after_entry_title and set the priority to 11.

The display rules would be Posts > All posts.

This archived topic is closed to new replies.