Title: Custom Functions
Last modified: August 16, 2019

---

# Custom Functions

 *  Resolved [wordmax](https://wordpress.org/support/users/wordmax/)
 * (@wordmax)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/custom-functions-3/)
 * Hello:
    Is it possible or recommended to use Ad Inserter to add custom functions?
   If so, what is the best way to do this? Is there any documentation about it?
 * Sorry if answer exists, I searched and didn’t see anything about custom functions.
   
   Thanks!

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

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11837798)
 * What do you mean by “custom functions”?
 *  Thread Starter [wordmax](https://wordpress.org/support/users/wordmax/)
 * (@wordmax)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11839276)
 * For example, I created a custom function so I can insert shortcode on a page 
   or post to display tag cloud within. The function can be added to the theme’s
   functions.php file but it will get over-written with a theme update. So I can
   use a plugin like My Custom Functions to insert/add my custom function, but I
   would use Ad Inserter instead to include the function if it works so I don’t 
   use an extra plugin if it’s not necessary.
 * custom function example for tag cloud shortcode:
    `add_shortcode( 'native_tagcloud','
   wp_tag_cloud' );`
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11846717)
 * No need to create a function.
    You can use Ad Inserter shortcodes to insert arbitrary
   HTML/Javascript/CSS/PHP code in any page or post: [https://adinserter.pro/documentation/manual-insertion#shortcodes](https://adinserter.pro/documentation/manual-insertion#shortcodes)
 *  Thread Starter [wordmax](https://wordpress.org/support/users/wordmax/)
 * (@wordmax)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11847084)
 * Good to know thanks. So, for example, I can implement this custom function and
   shortcode using Ad Inserter?
 * I’m not sure how…will have to trial and error I guess.
 *     ```
       // create [custom_rss] shortcode
       add_shortcode( 'custom_rss', 'execute_custom_rss_shortcode' );
       function execute_custom_rss_shortcode() {
         return do_shortcode('[wp_rss_retriever url="https://news.google.com/rss/search?q=' . get_the_title() . '&hl=en-US&gl=US&ceid=US%3Aen" items="8" excerpt="50" read_more="true" credits="false" new_window="true" cache="1800"]');
       }
       ```
   
    -  This reply was modified 6 years, 8 months ago by [wordmax](https://wordpress.org/support/users/wordmax/).
    -  This reply was modified 6 years, 8 months ago by [wordmax](https://wordpress.org/support/users/wordmax/).
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11850183)
 * If I understand your needs correctly you simply configure one block with your(
   long) shortcode
 * `[wp_rss_retriever url="https://news.google.com/rss/search?q=<?php get_the_title();?
   >&hl=en-US&gl=US&ceid=US%3Aen" items="8" excerpt="50" read_more="true" credits
   ="false" new_window="true" cache="1800"]`
 * and enable PHP processing and Ad Inserter shortcode for this block.
 * Assuming this is block 1 with name “Custom RSS” you can then use in posts either
 * `[ADINSERTER block="1"]`
    or `[ADINSERTER name="Custom RSS"]`
 * You can also use Ad Inserter shortcode `[ADINSERTER data='title']` to get post/
   page title but I’m not sure how it will behave nested in other shortcodes.

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

The topic ‘Custom Functions’ is closed to new replies.

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

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 5 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/custom-functions-3/#post-11850183)
 * Status: resolved