Title: Shortcode error
Last modified: June 25, 2020

---

# Shortcode error

 *  Resolved [jesa29](https://wordpress.org/support/users/jesa29/)
 * (@jesa29)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/shortcode-error-26/)
 * Hi!
    I’m trying to add some blocks via shortcodes.
 * First, I’ve added to category description (all is OK):
 *     ```
       add_filter( 'term_description', 'filter_function_name_386', 10, 4 );
       function filter_function_name_386( $value, $term_id, $taxonomy, $context ){
       	// filter...
   
       	return $value .= do_shortcode( '[the_ad id="1681"]' ); 
       }
       ```
   
 * After that I tried to do the same for tags, but it fails:
 *     ```
       add_filter( 'post_tag_description', 'filter_function_name_385', 10, 4 );
       function filter_function_name_385( $value){
       	// filter...
   
               //shortcode returns an empty string here
       	$aaa = do_shortcode( '[the_ad id="1681"]');
   
       	return $value. $aaa . 'ttt';
       }
       ```
   
 * So do_shortcode returns an empty string here, how can I fix it? Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * (@webzunft)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/shortcode-error-26/#post-13039503)
 * Hi jesa29,
 * thanks for reaching out.
 * Please verify that the second filter is working without Advanced Ads involved.
   E.g., you could give `$aaa` some static value and see if that works. I believe
   it could be an issue with the function in general and not the shortcode per se.
 * If returning a static string on the correct place works when please remove any
   conditions you might have set for the particular ad.
 * Thanks,
    Thomas
 *  Thread Starter [jesa29](https://wordpress.org/support/users/jesa29/)
 * (@jesa29)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/shortcode-error-26/#post-13047872)
 * Removing all stuff like Clearfix and type Adsense Ad helped, thnx
 *  Plugin Author [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * (@webzunft)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/shortcode-error-26/#post-13047882)
 * Thanks for your feedback. I am happy to read that it works now.
 * Best regards,
    Thomas

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode error’ is closed to new replies.

 * ![](https://ps.w.org/advanced-ads/assets/icon-256x256.gif?rev=2773443)
 * [Advanced Ads – Ad Manager & AdSense](https://wordpress.org/plugins/advanced-ads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-ads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-ads/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-ads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-ads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-ads/reviews/)

## Tags

 * [empty string](https://wordpress.org/support/topic-tag/empty-string/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [Thomas Maier](https://wordpress.org/support/users/webzunft/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/shortcode-error-26/#post-13047882)
 * Status: resolved