Community Forums › Forums › Archived Forums › General Discussion › Adsense shortcut removed in Genesis 3.0.1 [adsense_hint]
Tagged: adsense, Google Adsense
- This topic has 12 replies, 5 voices, and was last updated 5 years, 9 months ago by
Netzlichter.
-
AuthorPosts
-
June 20, 2019 at 11:48 pm #491791
Nordicfoodliving.com
MemberI've widely been using the Adsense hint shortcut ([adsense_hint]), to indicate where Auto Ads could be placed on my blog. After upgrading to Genesis 3.0.1 this function doesn't work and the shortcut is just shown in plain text all over my site.
Do you know if this function will return or I have to manually work through all my pages and remove this function?
Thanks in advance.
https://nordicfoodliving.com/stone-age-bread/June 21, 2019 at 12:01 am #491792Brad Dalton
ParticipantLooks like support has been removed but you could check the Genesis changelog. There was a recent question i saw about this.
You could do a DB query to find and remove them.
June 22, 2019 at 4:26 am #491838AnitaC
KeymasterIn the Genesis 3.0 update, your Auto Adsense code should have been automatically added to the Header Scripts box for you so you would not need to add it back. Check Genesis Settings > Header Scripts to make sure you code is there. If not, please post back.
Need help with customization or troubleshooting? Reach out to me.
June 24, 2019 at 10:27 am #491884Netzlichter
ParticipantHi there,
is there a solution for still using the [adsense_hint] shortcode? I have the same problem. Shortcode isn't working anymore and it is displayed as plain text...
June 24, 2019 at 2:34 pm #491892Victor Font
ModeratorSince support for Adsense Auto ads has been removed, you would need to create your own adsense_hint shortcode if you want to continue using the adsense_hint shortcode.
If the ad display is no longer important, I would create a shortcode that returns an empty string so you wouldn't have to go through all of your content to remove the shortcodes.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 25, 2019 at 2:03 am #491900Netzlichter
ParticipantHi,
but why was the support for Adsense Auto Ads been removed?
Is it somehow possible to use the shortcode again, because I used it to place my adds all other the page/ categories etc. :/.
Thank you.
June 27, 2019 at 2:18 am #491967Netzlichter
ParticipantWould be great if someone can point me in the right direction?
How did you solved your problem: Nordicfoodliving.com ?
Thank you :).
June 27, 2019 at 3:07 am #491968Nordicfoodliving.com
MemberIt seems that they have removed this feature in the latest version. I'll just make the short short cut myself according to this guide: https://www.elegantthemes.com/blog/tips-tricks/how-to-create-shortcodes-in-wordpress
June 27, 2019 at 3:30 am #491969Netzlichter
ParticipantDo you know what is the correct output of the removed shortcode?
June 27, 2019 at 4:39 am #491974Nordicfoodliving.com
MemberNo I don't know the code that Genesis used. However, I'll just put in an Responsive Adsense code.
June 27, 2019 at 4:49 am #491975Netzlichter
ParticipantI did a bit investigation and research.
Add this to your functions.php, then it is all working as before :).
NO EDITING REQUIRED :).//* Adsense Hint Shortcode function adsense_hint_shortcode_custom() { $defaults = array( 'id' => '', ); $atts = shortcode_atts( $defaults, $atts ); static $i = 1; $atts['id'] = sprintf( 'ad-%d-%d', get_the_ID(), $i ); $i++; $output = '<!-- adsense -->'; $output .= sprintf( '<div><ins id="adsense-hint-id-%s" style="display: none;" class="adsbygoogle-placeholder"></ins></div>', esc_attr( $atts['id'] ) ); return $output; } add_shortcode('adsense_hint', 'adsense_hint_shortcode_custom');
After you added the code above, the [adsense_hint] shortcode is woking on your pages again: https://nordicfoodliving.com/stone-age-bread/
Regards :).June 27, 2019 at 8:15 am #491978AnitaC
KeymasterJust to be safe on all future updates, you should follow the Google Auto Adsense instructions here - https://support.google.com/adsense/answer/7480616?hl=en. If the code provided by the participant above breaks on a Genesis or WordPress update, your ads will break. This is why it was removed.
Follow the instructions and manually place your code under the Genesis Settings > Header Scripts box.
Better to be safe now then sorry later.
Need help with customization or troubleshooting? Reach out to me.
June 27, 2019 at 9:43 am #491979Netzlichter
ParticipantAnita, can you tell me where is Google saying that the possibility to tell Google Auto ads possible places to show up? My code above does nothing than this. That is not an implementation for the google ads code itself. It only integrates a hidden div via the shortcode.
So tell me how can a further Genesis or WordPress update breaks my function? That is not true what you are telling here... Only what can happen is that google not display any ads instead of the hidden divs! A hidden div is a better solution than show plain text like [adsense_hint]...
Better to have a hidden div container in the content!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.