- This topic has 7 replies, 3 voices, and was last updated 5 years, 4 months ago by
Elvin.
-
AuthorPosts
-
December 8, 2020 at 9:53 am #1571886
Adam
Hello team,
I am looking to add an HTML code to a specific sub-category page. [https://inadamsshoes.com/category/travel-blog/road-trip/]
Stories >> Travel >> Road Trip
Stories is part of my main menu, Travel is a sub-item of Stories, and Road Trip is a sub-item of Travel.
Additionally, When opening the “Road Trip” page on my site, I would like the new HTML code to be placed under the featured article.
I have one article that displays itself at full-width at the top, and then the rest of the articles follow underneath in two columns. Ideally, I would like to have the HTML (which is an opt-in.. if that matters) placed underneath the full-width feature, and the following articles in the columns.Hopefully this description isn’t too confusing.
December 8, 2020 at 10:24 am #1571922Leo
StaffCustomer SupportHi there,
Not sure if I fully understand. Any chance you have an example to show?
If it’s relatively simple then we can try to point you in the right direction.
Let me know 🙂
December 8, 2020 at 11:41 am #1572010Adam
I don’t have an exact example to show you.
This might be less convenient than I had imagined, but I created a mock image to use as my example.

The HTML I am trying to place, is the same as the one at the bottom of my “Resources” page. The “Don’t Know What to Pack” Optin-in form.
Hope this helps..
December 8, 2020 at 3:00 pm #1572128Leo
StaffCustomer SupportSo basically you are trying to add some content after the featured post of a specific category archives?
Unfortunately there is no hook there.
December 8, 2020 at 4:12 pm #1572163Adam
correct, that is what I am trying to accomplish it seems..
December 9, 2020 at 2:50 am #1572542Elvin
StaffCustomer Supportcorrect, that is what I am trying to accomplish it seems..
As Leo mentioned, there’s no hook that goes directly after the featured post.
To achieve this, you’ll have to create a child theme with template for the blog, archive and search pages that adds a
if( $loop->current_post && !($loop->current_post == 1) ) { echo 'your HTML markup here' }condition.Alternatively, if you’re adding in a static markup, you can insert markup after a target element with JavaScript.
December 9, 2020 at 7:20 am #1573011Adam
Wow. Alright, thanks. Seems like more of hassle than it worth.
December 9, 2020 at 4:40 pm #1573668Elvin
StaffCustomer SupportWow. Alright, thanks. Seems like more of hassle than it worth.
No problem. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.