• Resolved paen511

    (@paen511)


    I have created a website recently using Lingonberry. I want to place ads under heading of all posts, between heading and content. However, when they are shown on homepage page(index.php), it seems to annoying readers(too many ads will be displayed). So is there any solution to remove adsense on my homepage?
    Remark that my website is underway to be approved from adsense but the code is already there.

    • This topic was modified 4 years, 10 months ago by paen511.
    • This topic was modified 4 years, 10 months ago by paen511.
    • This topic was modified 4 years, 10 months ago by paen511.
    • This topic was modified 4 years, 10 months ago by paen511.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @paen511,

    You can wrap the ad code like this:

    if ( ! is_home() ) {
    [code for the ad]
    }

    Which will make the ads display when not on the front page.

    Keep in mind that any changes you make directly to the theme files will be overwritten the next time a new version of Lingonberry is released. I'd recommend you to create a child theme and make your changes there - that way, your changes won't be overwritten by updates.

    — Anders

    Thread Starter paen511

    (@paen511)

    I cannot find the page and place to insert php code directly in the post. So right now I try to use plugin (phpCode Snippets by xyz PHP CODE) and generate shortcode to insert to the post and it seems to work. Thank you very much for your help. ??

    More question, in this case(using plugin to insert code), do I still need to create child theme or not?

    • This reply was modified 4 years, 10 months ago by paen511.
    • This reply was modified 4 years, 10 months ago by paen511.
    • This reply was modified 4 years, 10 months ago by paen511.
    Theme Author Anders Norén

    (@anlino)

    @paen511 Happy to hear it! No, when you add the advert directly to the post content with a short code, you don’t need to use a child theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to disable adsense on homepage page(index.php) ?’ is closed to new replies.