Sign in

custom html before content

  • This topic has 5 replies, 3 voices, and was last updated 3 years, 6 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2101
    Avatar photo[anonymous]

    Hi,

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

    #2103
    Avatar photoVerhoeckx

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

     

    See also this post:

    Statistics ?

     

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

    #2109
    Avatar photoTomasz Dziuda

    Hi,

    In this case the only way is using theme overrides: https://getpublii.com/dev/theme-overrides/

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

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

    #2117
    Avatar photoVerhoeckx

    You can’t use any these locations:

     

    <html>
        <head>
        </head>
    
        <body>
    
      {!-- Insert some custom code by Custom HTML tool --}}
      {{{@bodyCustomCode}}}
    
      
    <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).

     

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