Forums

[Plugin: Advertising Manager] True Shortcode support (1 post)

  1. ikusagami
    Member
    Posted 2 years ago #

    I was having trouble combining this plugin with Section Widget, mainly to display different ads based on tags or categories. As Section Widget allows shortcodes, I was confused [ad#name] wasn't working.

    After digging into the code, I've realized (being somewhat a wordpress noob), that [ad#name] isn't a real shortcode but a filter for posts. I just added the following into advertising-manager.php (blatantly based on the shorcode API page example):

    function advman_shortcode($atts) {
    	extract(shortcode_atts(array(
    		'name' => 'name'
    	), $atts));
    
    	return advman_ad($name);
    }
    add_shortcode('ad', 'advman_shortcode');

    And using it as [ad name="name"] works! But I'd really appreciate if you could give an "official" version for this shortcode ;-)

    Thanks for this great plugin, BTW!

Topic Closed

This topic has been closed to new replies.

About this Topic