Tagged: google adsense
-
AuthorPosts
-
September 16, 2014 at 5:25 am #319569
hi,
How can I add a Google Adsense below the content of the post? Using Functions..
I was able to add this function Adsense banner after breadcrumbs
function after_breadcrumb_func($breadcrumb){ $output = $breadcrumb; $output .= "<div>adsense here</div>"; return $output; } add_action('avia_breadcrumbs', 'after_breadcrumb_func');
What about after content of post in page and post?
Thanks
September 16, 2014 at 6:34 am #319583Hey!
There is a hook called “ava_after_content” you can use:
function after_breadcrumb_func($content = ""){ if($context == "page" || $context == "single-portfolio") echo "<div>adsense here</div>"; } add_action('ava_after_content', 'after_breadcrumb_func', 10, 2);
Best regards,
JosueSeptember 16, 2014 at 8:07 am #319637Hi Josue
Thanks for the reply…
I try this code .. but i have no luck
.title_container .breadcrumb { top: 15% !important; }
I want to look my adsense in breadcrumbs like this
Thanks
September 16, 2014 at 8:19 am #319646I got an error with this code..
function after_breadcrumb_func($content = ""){ if($context == "page" || $context == "single-portfolio") echo "<div>adsense here</div>"; } add_action('ava_after_content', 'after_breadcrumb_func', 10, 2);
[16-Sep-2014 06:17:18] PHP Fatal error: Cannot redeclare after_breadcrumb_func() (previously declared in /ph/wp-content/themes/enfold/functions.php:504) in /ph/wp-content/themes/enfold/functions.php on line 523`
- This reply was modified 10 years, 2 months ago by jalmz.
September 16, 2014 at 2:21 pm #319864Hey!
Please try changing the code to following one
function after_breadcrumb_funct($content = ""){ if($context == "page" || $context == "single-portfolio") echo "<div>adsense here</div>"; } add_action('ava_after_content', 'after_breadcrumb_funct', 10, 2);
you already have a function declared with the same name, that causes the issue
Best regards,
YigitSeptember 16, 2014 at 3:04 pm #319898Thanks Ligit..
Yes but it does not work…
this is my code
function after_breadcrumb_funct($content = ""){ if($context == "page" || $context == "single-portfolio") echo "<div>adsense here</div>"; } add_action('ava_after_content', 'after_breadcrumb_funct', 10, 2);
i deleted this one..
function after_breadcrumb_func($breadcrumb){ $output = $breadcrumb; $output .= 'ads'; return $output; } add_action('avia_breadcrumbs', 'after_breadcrumb_func');
- This reply was modified 10 years, 2 months ago by jalmz.
September 16, 2014 at 4:51 pm #319999Hi!
Try this code:
function after_content_func($content = ""){ if($context == "post") echo "<div>adsense here</div>"; } add_action('ava_after_content', 'after_content_func', 10, 2);
Regards,
JosueSeptember 17, 2014 at 3:22 am #320263hi Josue..
Still the code does not work
September 17, 2014 at 5:33 am #320298Hi,
Can you please create me an administrator account? post it here as a private reply.
Regards,
JosueSeptember 17, 2014 at 6:44 am #320318This reply has been marked as private.September 17, 2014 at 7:11 am #320336Hi,
It’s working now, modify it at functions.php.
Cheers!
JosueSeptember 17, 2014 at 7:43 am #320350Yes it works thanks..
but look…
what about the pages? thanks
- This reply was modified 10 years, 2 months ago by jalmz.
September 17, 2014 at 7:47 am #320353Hi!
You’d need to change the context condition:
if($context == "post")
To:
if($context == "post" || $context == 'page')
Cheers!
JosueSeptember 17, 2014 at 7:58 am #320358Josue.. Thanks what about the design? any css?
September 17, 2014 at 7:31 pm #320682Hi!
Try with this:
.entry-footer ins.adsbygoogle { position: relative; top: 65px; }
Best regards,
JosueSeptember 18, 2014 at 5:27 am #320873September 18, 2014 at 5:33 am #320879I’m not seeing the code added to your Quick CSS:
http://www.biliranisland.com/ph/wp-content/uploads/dynamic_avia/enfold.css?ver=54192b49eab3aBest regards,
JosueSeptember 18, 2014 at 5:42 am #320888Its ok now Josue.. Thanks for the hint.. One last problem is the breadcrumbs..
September 18, 2014 at 5:53 am #320895Hey!
Adsense is appearing as expected before the breadcrumbs.
Regards,
JosueSeptember 18, 2014 at 11:30 am #321087Thanks Josue,
I suggest you should include this in your theme features. Adsense ready enfold theme..
again Thanks!
September 18, 2014 at 12:20 pm #321108 -
AuthorPosts
- You must be logged in to reply to this topic.