Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to position 1 adsense ad at end of main body content?
- This topic has 14 replies, 3 voices, and was last updated 10 years, 11 months ago by dracer.
-
AuthorPosts
-
May 16, 2013 at 11:58 am #41228dracerMember
Hello All,
I went to tech support for help with this and they suggested I post here. I do not like to have advertising at the top of my pages, or in the left or right sidebars. I prefer to put a single adsense ad in, right at the end of the content I typed it, whether it be a static page or a blog page showing a list of posts.
I tried the simple hooks but could not get the positioning I am trying to get. I want to position the ad right after whatever I type into the text entry box in WordPress. I want the ad to appear after that and before any other info that is auto inserted by WP such as the "Filed Under" line, places for people to respond to my post, etc.
Here is a sample page: http://womensmotocross.com/news/2013-wmx-womens-motocross-triple-crown
I want to insert an ad right after the last paragraph and before the "Filed Under News" notice.
Thank you in advance for your time, I would greatly appreciate any assistance.
May 16, 2013 at 12:34 pm #41240AnitaKeymasterYou should post it in this hook area - genesis_after_post_content
Love coffee, chocolate and my Bella!
May 16, 2013 at 2:32 pm #41253dracerMemberHello Anitac,
Thank you for your swift assistance.
I did as you instructed and that gets it very close. That puts the info directly under that “Filed Under News” notice. If you look at my sample page now you will see where I added the text "Testforadblock" using the hook location you suggested.
Do you know a way to get it right above the “Filed Under" notice? That would put it exactly where I want it.
May 16, 2013 at 3:03 pm #41258AnitaKeymasterWell, if you look at this sample post from the Visual Hook Guide the position I gave you should place it ABOVE the "Filed Under". Go back and make sure you have placed your code in - genesis _after_post_content and not the genesis_after_post. Make sure you have placed it in the box that has the word "CONTENT" after it.
http://genesistutorials.com/visual-hook-guide/2012/01/01/headlines/
Love coffee, chocolate and my Bella!
May 16, 2013 at 3:57 pm #41269dracerMemberI think I have it where you are instructing. I copied and pasted the following from the simple hooks block where I have entered it:
`genesis_after_post_content` Hook
This hook executes immediately after the `genesis_post_content` hook for each post/page within the loop.Unhook `genesis_post_meta()` function from this hook?
Does that look correct?
May 16, 2013 at 5:17 pm #41275Brad DaltonParticipantAdd a widget:
Copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.
Displays widget content immediately after content on posts, pages, archives
May 16, 2013 at 6:44 pm #41279dracerMemberHello Brad,
And thank you for helping. When I click on that link that, or try to open it manually, I do not get anything but a blank page. If I do a "view source" it still only displays a blank page.
Am I supposed to do something with that link, other than trying to open it with my browser?
Ignore the above. For some reason now the code is showing up here on the forum, before there was nothing displaying embedded in your post.
I will give this a try ASAP.
May 16, 2013 at 6:48 pm #41283Brad DaltonParticipantClick the view raw link or use this link https://gist.github.com/braddalton/5595837
Maybe you can't see the code because of the browser but I see it in I.E.
Please try another browser.
hahaha. Its Githubs fault. Sometimes they have caching issues and the code doesn't render properly on the page.
May 16, 2013 at 6:56 pm #41284dracerMemberFYI, I am using the "Prose" child them with Genesis. Brad, Am I supp0sed to enter that code in Prose functions.php code block that says never to modify it, or in the "custom code" section of Genesis?
I tried it both places, but once entering it I do not see any new entry under the widgets to use it.
Sorry for all the questions. I am new to modifying something like this. Thanks for your help and patience.
May 16, 2013 at 7:33 pm #41287dracerMemberOK, I got it working but it is placing the results on the page below the "Filed Under" line. I left it up on the site so you can see where it is placing it.
May 16, 2013 at 7:40 pm #41288Brad DaltonParticipantMay 16, 2013 at 7:43 pm #41289Brad DaltonParticipantMay 16, 2013 at 7:48 pm #41290Brad DaltonParticipantAdd this after the code I gave you.
Don't forget, the content will also display on archive excerpts.
May 16, 2013 at 7:55 pm #41292Brad DaltonParticipantYou can also add some padding to the post meta http://my.studiopress.com/snippets/post-meta/
Or add it to the custom widget.
May 17, 2013 at 7:10 am #41346dracerMemberI do not know why but I never could get it to display above that "Filed Under" line so I am using that last bit of code you provided Brad and that has given me the look I prefer.
Thank you both for taking the time to help, it is greatly appreciated.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.