• Resolved llrajsll

    (@llrajsll)


    Hello,

    Thank you for the awesome theme.

    I need to place the code given below at the very bottom (Just above the footer) of the homepage/archive pages/search pages. Basically every page except for the content pages (posts):

    <?php if (function_exists (‘adinserter’)) echo adinserter (n); ?>

    Could you please guide me on how I can do that? I’m not much proficient with coding.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,
    Add this to your child theme’s functions.php

    add_action('__after_footer', 'my_after_footer');
    function my_after_footer(){
      if (! is_singular() ) {//Exclude pages and posts
        if (function_exists ('adinserter')) echo adinserter (n);
      }
    }

    Thread Starter llrajsll

    (@llrajsll)

    Hello,

    Thanks for the help. However, this is shows AFTER the footer whereas I need it to appear JUST BEFORE the footer.

    Here’s a screenshot so that you can get the idea easily.

    Cheers

    Just change it to this

    add_action('__before_footer', 'my_footer');
    function my_footer(){
      if (! is_singular() ) {//Exclude pages and posts
        if (function_exists ('adinserter')) echo adinserter (n);
      }
    }

    Thread Starter llrajsll

    (@llrajsll)

    Wow thanks, You’re amazing. Hope you prosper even more.

    Cheers,
    Raj Sandhu.

    Would you mind marking this post as resolved?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Adding code to theme files’ is closed to new replies.