Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #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

    #319583

    Hey!

    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,
    Josue

    #319637

    Hi 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

    #319646

    I 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 9 years, 7 months ago by jalmz.
    #319864

    Hey!

    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,
    Yigit

    #319898

    Thanks 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 9 years, 7 months ago by jalmz.
    #319999

    Hi!

    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,
    Josue

    #320263

    hi Josue..

    Still the code does not work

    #320298

    Hi,

    Can you please create me an administrator account? post it here as a private reply.

    Regards,
    Josue

    #320318
    This reply has been marked as private.
    #320336

    Hi,

    It’s working now, modify it at functions.php.

    Cheers!
    Josue

    #320350

    Yes it works thanks..

    but look…

    what about the pages? thanks

    • This reply was modified 9 years, 7 months ago by jalmz.
    #320353

    Hi!

    You’d need to change the context condition:

    if($context == "post")
    

    To:

    if($context == "post" || $context == 'page')
    

    Cheers!
    Josue

    #320358

    Josue.. Thanks what about the design? any css?

    #320682

    Hi!

    Try with this:

    .entry-footer ins.adsbygoogle {
    position: relative;
    top: 65px;
    }

    Best regards,
    Josue

    #320873

    Hi Josue,

    The css code does not work..

    • This reply was modified 9 years, 7 months ago by jalmz.
    #320879

    I’m not seeing the code added to your Quick CSS:
    http://www.biliranisland.com/ph/wp-content/uploads/dynamic_avia/enfold.css?ver=54192b49eab3a

    Best regards,
    Josue

    #320888

    Its ok now Josue.. Thanks for the hint.. One last problem is the breadcrumbs..

    #320895

    Hey!

    Adsense is appearing as expected before the breadcrumbs.

    Regards,
    Josue

    #321087

    Thanks Josue,

    I suggest you should include this in your theme features. Adsense ready enfold theme..

    again Thanks!

    #321108

    Hi!

    Please request it here – https://kriesi.at/support/enfold-feature-requests/

    Best regards,
    Yigit

Viewing 21 posts - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.