Title: $post = null using shortcode in custom loop
Last modified: July 9, 2018

---

# $post = null using shortcode in custom loop

 *  Resolved [eligence](https://wordpress.org/support/users/eligence/)
 * (@eligence)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/post-null-using-shortcode-in-custom-loop/)
 * I am using the shortcode to generate social sharing links in a custom post loop
   and am dynamically passing in the urls (see my previous post support ticket [here](https://wordpress.org/support/topic/social-sharing-copy-link-not-working/)).
   This is throwing php notices every post as in super-socializer/inc/social_sharing.
   php `the_champ_prepare_sharing_html()` is declaring `$post` as global. In this
   use case `$post = null`. This can be fixed by adding
 *     ```
        if (NULL === $post) {
               $post = get_post($shareCountTransientId);
       } 
       ```
   
 * on line 14.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Heateor Support](https://wordpress.org/support/users/heateor/)
 * (@heateor)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/post-null-using-shortcode-in-custom-loop/#post-10478067)
 * Please refer to the thread [https://wordpress.org/support/topic/using-shortcode-post-null/](https://wordpress.org/support/topic/using-shortcode-post-null/)

Viewing 1 replies (of 1 total)

The topic ‘$post = null using shortcode in custom loop’ is closed to new replies.

 * ![](https://ps.w.org/super-socializer/assets/icon-128x128.png?rev=1866723)
 * [Social Share, Social Login and Social Comments Plugin - Super Socializer](https://wordpress.org/plugins/super-socializer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/super-socializer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/super-socializer/)
 * [Active Topics](https://wordpress.org/support/plugin/super-socializer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/super-socializer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/super-socializer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Heateor Support](https://wordpress.org/support/users/heateor/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/post-null-using-shortcode-in-custom-loop/#post-10478067)
 * Status: resolved