Title: Limit activity published from shortcode
Last modified: June 19, 2018

---

# Limit activity published from shortcode

 *  [larnoult](https://wordpress.org/support/users/larnoult/)
 * (@larnoult)
 * [8 years ago](https://wordpress.org/support/topic/limit-activity-published-from-shortcode/)
 * Hello,
    I’m using BP activity shortcode to display the “what’s new” activity 
   form on posts. I edited your _maybe_load_scripts() function to have it run on
   posts:
 *     ```
            public function _maybe_load_scripts() {
                   global $bp;
   
                   if ( // Load the scripts on Activity pages
                       (defined('BP_ACTIVITY_SLUG') && bp_is_activity_component())
                       ||
                       // Load the scripts when Activity page is the Home page
                       (defined('BP_ACTIVITY_SLUG') && 'page' == get_option('show_on_front') && is_front_page() && BP_ACTIVITY_SLUG == get_option('page_on_front'))
                       ||
       				(is_single(''))
       				||
                       // Load the script on Group home page
                       (defined('BP_GROUPS_SLUG') && bp_is_groups_component() && 'home' == $bp->current_action)
                       ) {
                       add_action( "wp_enqueue_scripts", array (&$this, 'enqueue_scripts') );
                       add_action( "wp_print_scripts", array ( &$this, 'print_style' ) );
                   }
               }
       ```
   
 * Although the actual posted activity will be truncated, the script won’t show 
   neither the countdown nor the “live” cut.. Any idea how to fix that?
 * Best,

The topic ‘Limit activity published from shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bp-limit-activity-length_7599a6.svg)
 * [BP Limit Activity Length](https://wordpress.org/plugins/bp-limit-activity-length/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-limit-activity-length/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-limit-activity-length/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-limit-activity-length/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-limit-activity-length/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-limit-activity-length/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [larnoult](https://wordpress.org/support/users/larnoult/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/limit-activity-published-from-shortcode/)
 * Status: not resolved