Title: Template Functions Error
Last modified: December 18, 2023

---

# Template Functions Error

 *  Resolved [advwebmaster777](https://wordpress.org/support/users/advwebmaster777/)
 * (@advwebmaster777)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/)
 * After activating the plugin and using the template functions mentioned on the
   help page ([https://pramadillo.com/plugins/woocommerce-pay-per-post/](https://pramadillo.com/plugins/woocommerce-pay-per-post/)),
   I encountered the following errors.
 * Template Function:
 *     ```wp-block-code
       <?php if(Woocommerce_Pay_Per_Post_Helper::has_access()): ?>
           This is the content that a user should see if they paid for the post
       <?php else: ?>
           <?php echo Woocommerce_Pay_Per_Post_Helper::get_no_access_content(); ?>
       <?php endif; ?>  
       ```
   
 * Errors:
 *     ```wp-block-code
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 60
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 63
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 227
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 229
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 134
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 227
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 229
   
       Warning: Trying to access array offset on value of type null in /sites/***/files/wp-content/plugins/woocommerce-pay-per-post/public/class-woocommerce-pay-per-post-restrict-content.php on line 134
       ```
   

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

 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/#post-17285863)
 * Hey [@advwebmaster777](https://wordpress.org/support/users/advwebmaster777/),
 * Those are PHP Warnings if you are running this on a production site you should
   have that turned off. [https://www.wpbeginner.com/wp-tutorials/how-to-turn-off-php-errors-in-wordpress/](https://www.wpbeginner.com/wp-tutorials/how-to-turn-off-php-errors-in-wordpress/)
 * Couple of questions:
    - Can I ask what version of the plugin you are running?
    - Are you able to show your full template to me?
    - Does the functions still work and is just showing the warning?
 *  Thread Starter [advwebmaster777](https://wordpress.org/support/users/advwebmaster777/)
 * (@advwebmaster777)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/#post-17285958)
 * Hi Matt ( [@mattpramschufer](https://wordpress.org/support/users/mattpramschufer/))
 * Thank you for the quick reply.
 * Version is 3.1.17
 * I use Cwicly theme editor, this is paid theme 🙁 
   Screenshot [https://d.pr/i/ALDYiZ](https://d.pr/i/ALDYiZ)
 * Even though this error is occurring, it only appears in the backend and does 
   not affect the frontend.
 * Should I not worry about this error?
 *  Plugin Author [Matt Pramschufer](https://wordpress.org/support/users/mattpramschufer/)
 * (@mattpramschufer)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/#post-17285968)
 * That is what I was going to ask next. 🙂 It is probably showing those error because
   the page builder is trying to load the frontend and it doesn’t have the same 
   hooks as the frontend. You can simply ignore those warnings or disable error 
   reporting like I mentioned previously.
 *  Thread Starter [advwebmaster777](https://wordpress.org/support/users/advwebmaster777/)
 * (@advwebmaster777)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/#post-17285996)
 * Hi Matt, thank you for your response!
   My worries have been alleviated. Please
   continue the good work.

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

The topic ‘Template Functions Error’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pay-per-post/assets/icon-256x256.png?rev=2252656)
 * [Pay For Post with WooCommerce](https://wordpress.org/plugins/woocommerce-pay-per-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pay-per-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pay-per-post/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pay-per-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pay-per-post/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [advwebmaster777](https://wordpress.org/support/users/advwebmaster777/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/template-functions-error/#post-17285996)
 * Status: resolved