• Resolved Paul

    (@rhododendron)


    I need to add one HTML code just before the footer and after the Latest post part.

    Please help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • always the same code you used with other hooks. now the hook you’re looking for is:
    __before_footer

    Thread Starter Paul

    (@rhododendron)

    I have tried that. not working

    Can you have a check?

    can you paste here the code you used..? (remember to use “backticks”)

    Thread Starter Paul

    (@rhododendron)

    add_filter('tc_slider_display', 'content_before_footer');
    function content_before_footer($html) {
    $after_slider = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- postbottom -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-**************1"
         data-ad-slot="6331971740"
         data-ad-format="auto"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>'; //Put your HTML inside this var
    return $html.$after_slider;
    }

    and you put that code after slider.
    that’s the code:

    add_action('__before_footer', 'content_before_footer', 1);
    function content_before_footer() {
    ?>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- postbottom -->
    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-**************1"
         data-ad-slot="6331971740"
         data-ad-format="auto"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>
    <?php
    }

    Thread Starter Paul

    (@rhododendron)

    OOpsss! sorry. Didnt notice. ??

    sorry for the trouble.
    And many thanks for the code! ??

    Np ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘adding a HTML code before the footer’ is closed to new replies.