Archived topic
How to create an "affiliate box" with a piece of code?
8 replies · Started by Shane on March 17, 2023
How to create an "affiliate box" with a piece of code that is managed in the backend instead of at the article level?
E.g., I want to create an "affiliate box" like the one in the link right before the table of content.
This is so I don't have to create and update different affiliate boxes at each article, e.g., the best X in City N1, the best X in City N2, the best X in City N100.
I can simply place the code for the affiliate box for at each article, and manage and update just one the affiliate box.
I remember I used GP element to do this.
But, I can't seem to find it anymore...
Please can you give me some advice?
Thanks.
SJ
Hi there,
I can simply place the code for the affiliate box for at each article, and manage and update just one the affiliate box.
It's not very easy as GP doesn't have hooks in the content area.
Is the content in the box different for different posts?
Let me know!
Hi Ying, thanks for replying.
No, I expect the content in the box to be the same across different articles in the same content pillar/tag.
Hi Shane,
Where on the post you linked for instance do you want the "Affiliate Box" to appear?
Like this one rRight before the table of content: https://www.scijournal.org/articles/highest-paying-international-relations-jobs
What you can do is Hook it after a specific number of paragraph: https://generatepress.com/forums/topic/element-after-first-paragraph/#post-1937353
Another approach is to manually add a portable hook for each post. Example: https://generatepress.com/forums/topic/hooks-related-question/#post-2170598
Hi, for some reason, I can't click the New Support Forum to create a new topic... even though I'm logged in already.
Can you help me take a look at this log-in issue?
How to use GP to create a toggle Q&A section like the button part of the link below?
https://thewebsiteflip.com/website-flipping-course/#fullaccess
Thanks.
SJ
Hi there,
our support forums have moved, go to:
Follow the steps provided to register in the new support forum.