{"id":1356017,"date":"2017-09-28T05:09:38","date_gmt":"2017-09-28T12:09:38","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/"},"modified":"2017-09-28T05:09:38","modified_gmt":"2017-09-28T12:09:38","slug":"division-by-zero","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/","title":{"rendered":"Division by zero"},"content":{"rendered":"<p>I am getting multiple messages in my error log that say:<br \/>\n\u201cPHP Warning: Division by zero in \/\u2026.\/public_html\/events\/wp-includes\/comment-template.php on line 1381\u201d. I have deactivated all my plugins to test them. The problem is that when I deactivate The Events Calendar plugin, it disables the site and all I get is a blank page so I have to reactivate that to work with the others. With all others deactivated, and reactivated one by one, it seems that the only one generating this PHP Warning is The Events Calendar plugin.<br \/>\nThe error I get when it is deactivated is:<br \/>\n[28-Sep-2017 11:54:01 UTC] PHP Fatal error:  Class &#8216;Tribe__Events__Template_Factory&#8217; not found in \/home\/stcwdc\/public_html\/events\/wp-content\/themes\/aaron-child\/functions.php on line 307<br \/>\n[28-Sep-2017 11:54:08 UTC] PHP Fatal error:  Class &#8216;Tribe__Events__Template_Factory&#8217; not found in \/home\/stcwdc\/public_html\/events\/wp-content\/themes\/aaron-child\/functions.php on line 292<\/p>\n<p>I created a small file to show which lines are being referred to and tried to upload it below bug I&#8217;m told &#8220;You can&#8217;t upload files of this type.&#8221; I tried it as .php and as .txt What type of files can be uploaded?<\/p>\n<p>I&#8217;ll try backward ticks to see if the code can be included in this post (the following lines are Lines 282-382 in functions.php). What needs to be changed in these lines to let the site work if the plugin is deactivated? Is any of this affecting the warning about division by zero?<\/p>\n<pre><code>&lt;?php\n\/\/\n\/\/ *************************************\n\/\/ Events Calendar fix\n\/\/ Ensures proper css and javascript have been enqueued in the theme header\n\/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\/\/\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;enqueue_month_view_scripts&#039;);\nfunction enqueue_month_view_scripts() {\nif ( is_front_page() ) {\nTribe__Events__Template_Factory::asset_package(&#039;ajax-calendar&#039;);\nTribe__Events__Template_Factory::asset_package(&#039;events-css&#039;);\n}\n}\n?&gt;\n&lt;?php\n\/\/\n\/\/ *************************************\n\/\/ Events Calendar fix\n\/\/ Ensures proper css and javascript have been enqueued in the theme header\n\/\/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\/\/\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;enqueue_week_view_scripts&#039;);\nfunction enqueue_week_view_scripts() {\nif ( !is_front_page() ) {\nTribe__Events__Template_Factory::asset_package(&#039;ajax-calendar&#039;);\nTribe__Events__Template_Factory::asset_package(&#039;events-css&#039;);\n}\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;enqueue_list_view_scripts&#039;);\nfunction enqueue_list_view_scripts() {\nif ( !is_front_page() ) {\nTribe__Events__Template_Factory::asset_package(&#039;ajax-calendar&#039;);\nTribe__Events__Template_Factory::asset_package(&#039;events-css&#039;);\n}\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;enqueue_photo_view_scripts&#039;);\nfunction enqueue_photo_view_scripts() {\nif ( !is_front_page() ) {\nTribe__Events__Template_Factory::asset_package(&#039;ajax-calendar&#039;);\nTribe__Events__Template_Factory::asset_package(&#039;events-css&#039;);\n}\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;enqueue_map_view_scripts&#039;);\nfunction enqueue_map_view_scripts() {\nif ( !is_front_page() ) {\nTribe__Events__Template_Factory::asset_package(&#039;ajax-calendar&#039;);\nTribe__Events__Template_Factory::asset_package(&#039;events-css&#039;);\n}\n}\n?&gt;\n<\/code><\/pre>\n<p>Thanks for your help.<\/p>\n","protected":false},"template":"","class_list":["post-1356017","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Division by zero -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Division by zero -\" \/>\n<meta property=\"og:description\" content=\"I am getting multiple messages in my error log that say: \u201cPHP Warning: Division by zero in \/\u2026.\/public_html\/events\/wp-includes\/comment-template.php on line 1381\u201d. I have deactivated all my plugins to test them. The problem is that when I deactivate The Events Calendar plugin, it disables the site and all I get is a blank page so I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/\",\"name\":\"Division by zero -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-09-28T12:09:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Division by zero\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Division by zero -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/","og_locale":"en_US","og_type":"article","og_title":"Division by zero -","og_description":"I am getting multiple messages in my error log that say: \u201cPHP Warning: Division by zero in \/\u2026.\/public_html\/events\/wp-includes\/comment-template.php on line 1381\u201d. I have deactivated all my plugins to test them. The problem is that when I deactivate The Events Calendar plugin, it disables the site and all I get is a blank page so I [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/","name":"Division by zero -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-09-28T12:09:38+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/division-by-zero\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Division by zero"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1356017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1356017\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1356017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}