more ad placements and option to use pub ID instead of code

How can I add more ad placements? How can I share top placement as well as side bar ads placement with the author? Instead of placements why can't we ask for the pub ID and rotate all of the replacement according to the percentage? Would not it have been easier to manage that way?

  • Kasia Swiderska
    • Support nomad

    Hello chodhry,

    In that moment Ad Sharing don't have build in option to add more "ad locations" than before/after posts and before/after pages.
    I will move this post to Features & Feedback - hopefully more members will support adding more locations for ads.
    In the meantime I will ping developer if there is a quick snippet code, that you could use to insert add somewhere else.

    Kind regards,
    Kasia

  • Hoang Ngo
    • Code Slayer

    Hi @chodhry,

    I hope you are well today.

    For adding new ads placement, we will need to implement some custom coding. I created a shortcode, so can display the ads anywhere you want. Example if you want to get the before ads, you can do like this
    [ad_sharing where="before"]
    Similar, for the after
    [ad_sharing where="after"]
    For using this shortcode, please add this code to your theme functions.php or use mu-plugins

    add_shortcode( 'ad_sharing', 'get_ad_sharing' );
    function ad_sharing_before( $atts ) {
    	$atts = wp_parse_args( $atts, array(
    		'where' => 'before'
    	) );
    	global $ad_sharing;
    
    	return $ad_sharing->get_ad_code( $atts['where'] );
    }

    For the Pub ID, because the plugin support various advertise programs, not only Google Adsense so that why we use the html/script input instead of only Pub ID.

    If you have any additional issues, please let us know and we'll be happy to help.

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.