Site logo

[Resolved] HTML code on a specific sub-menu page

Home Forums Support [Resolved] HTML code on a specific sub-menu page

Home Forums Support HTML code on a specific sub-menu page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #1571922
    Leo
    Staff
    Customer Support

    Hi 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 🙂

    #1572010
    Adam

    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..

    #1572128
    Leo
    Staff
    Customer Support

    So basically you are trying to add some content after the featured post of a specific category archives?

    Unfortunately there is no hook there.

    #1572163
    Adam

    correct, that is what I am trying to accomplish it seems..

    #1572542
    Elvin
    Staff
    Customer Support

    correct, 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.

    #1573011
    Adam

    Wow. Alright, thanks. Seems like more of hassle than it worth.

    #1573668
    Elvin
    Staff
    Customer Support

    Wow. Alright, thanks. Seems like more of hassle than it worth.

    No problem. 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.