We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

custom html before content

  • #2101
    Avatar photo[anonymous]


    Is there a way to add custom HTML before and after content instead of before and after post?

    Avatar photo[anonymous]

    You can use the Custom HTML Tool for this (Tools -> Custom HTML).

    See also this post:

    Statistics ?

    Avatar photo[anonymous]

    There are two settings in the custom HTML tool- before the post and after the post. I wanted to inject custom HTML just before and just after the content.

    Avatar photo[anonymous]


    In this case the only way is using theme overrides:

    Avatar photo[anonymous]

    Which file has the settings for custom html? Cannot I just change ‘before and after post’ settings to ‘before and after content’? Suppose I am adding adsense code and want it to show just before the content or just after, not right below the header.

    Avatar photo[anonymous]

    You can’t use any these locations:

      {!-- Insert some custom code by Custom HTML tool --}}
    <main class="main"> {{#if @customHTML.beforePost}} {{/if}} {{#if @customHTML.afterPost}} {{/if}} </main>
    {{!-- Insert some custom code by Custom HTML tool --}} {{{@footerCustomCode}}} </body> </html>

    If not, don’t forget that you have full control over your theme!

    All the code is there and you can add whatever you want (see the developers documentation).