WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] adding a HTML code before the footer (8 posts)

  1. Paul
    Member
    Posted 3 months ago #

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

    Please help.

  2. d4z_c0nf
    Member
    Posted 3 months ago #

    always the same code you used with other hooks. now the hook you're looking for is:
    __before_footer

  3. Paul
    Member
    Posted 3 months ago #

    I have tried that. not working

    Can you have a check?

  4. d4z_c0nf
    Member
    Posted 3 months ago #

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

  5. Paul
    Member
    Posted 3 months ago #

    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;
    }
  6. d4z_c0nf
    Member
    Posted 3 months ago #

    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
    }
  7. Paul
    Member
    Posted 3 months ago #

    OOpsss! sorry. Didnt notice. :(

    sorry for the trouble.
    And many thanks for the code! :P

  8. d4z_c0nf
    Member
    Posted 3 months ago #

    Np :D

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.