Adsense option just on index page?

  • madkadster

    #1957

    Hi

    I like the opetion with the adsense as I like where it shows on my index page or home page, but I didnt really want it on the other pages, is there a way I can just place it on the index page?

    please note I have a child theme page by help off Syahir Hakim in the past, look here what he did if needed:

    https://forum.graphene-theme.com/graphene-support/posts-page-home-page-to-look-like-achieves-page-or-categories-page

    maybe I could hard code this in the home.php file?

    site is http://www.unleashedbeasts.com

    Thanks

    Anonymous

    #18033

    You can create a function and use an action hook to display it in your pages. Then use a conditional statement to ONLY show it on the page you desire.

    Slightly advanced, but it CAN be done.

    Mod

    Kenneth John Odle

    #18034

    If you want it in a sidebar, you can always use the alternate front page widgets option. Otherwise, Josh’s idea is the way to go.

    madkadster

    #18035

    Just under the slider really is where i was after it, i dont have a clue how to use a “action hook” 🙁

    Mod

    Kenneth John Odle

    #18036

    madkadster

    #18037

    thanks mate I will tae a look at that and see how it works, but question isn’t this allot of work when I could just add the code within a file that shows there?

    Anonymous

    #18038

    In theory, yes. In practice, NO. The problem is, this is the first tweak. You know there will be more. Then, when the new version of Graphene is released, you must remember EVERY tweak you made to core files, and update them accordingly.

    By using action hooks, you keep all your modifications in the child theme, so when the new version is installed, and replaces all your parent files, your changes will remain unscathed.

    Trust me, it is MUCH more work to redo your mods, than it is to handle your changes from a child theme.

    Long story short.. You will safely be able to update your Graphene without having to redo all the modifications you made.

    madkadster

    #18039

    I see what you mean and agree, OK I will try and figure it out lol, thanks

    madkadster

    #18040

    I was looking into this action hook thing and my head was starting to hurt allot

    so what I did as I thought I would need to do some testing I installed a new wordpress on another domain I have and installed the latest Graphene theme and my child theme on that site, then I seen that in the options there is a action hook option in the advanced section and I can add a widget under the slider with it lol, that’s great, clever and just what I needed

    So I will do an update on my real site and hope I dont brake it 😀

    thanks for the support on this

    Mod

    Kenneth John Odle

    #18041

    in the options there is a action hook option in the advanced section

    I keep forgetting that this is now here in version 1.5, but it is exactly what you are looking for. Let us know how it works out.

    hope I dont brake it

    Just take good notes so you know what you did in case you need to undo it.

    Ken

Viewing 10 posts - 1 through 10 (of 11 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!