Community Forums › Forums › Archived Forums › General Discussion › Error – Division by zero on Embed
Tagged: Division by Zero, Embed Content, error, Metro Pro, News Pro, Theme Compat
- This topic has 5 replies, 2 voices, and was last updated 7 years, 10 months ago by
OC2PS.
-
AuthorPosts
-
March 19, 2017 at 4:29 am #203376
OC2PS
MemberNews Pro is returning the error
Warning: Division by zero in public_html/wp-includes/theme-compat/embed-content.php on line 33
when I embed a link from the same WordPress site in a post.See: https://hennalap.com/hajfestes-henna/
Metro Pro, running on a different site but same server, seems not to have the issue:
https://arcfestesmintak.hu/arjhay-az-elkotelezett-arcfesto/This is weird... I thought WordPress falls back on Theme Compat only if a theme does not have the needed template, and that Genesis child themes are merely a bunch of CSS to modify the look of Genesis. Metro Pro working would indicate that Genesis has embed-content.php template, and yet News Pro is falling back on Theme Compat.
https://hennalap.com/hajfestes-henna/March 19, 2017 at 4:31 am #203377OC2PS
MemberP.S. In the above post, why did arcfestesmintak.hu site URL's anchor text become the post title, while for the hennalap.com site, the URL became the anchor text?
March 20, 2017 at 8:40 am #203464Victor Font
ModeratorGenesis does not have an embed-content.php template. Neither News Pro nor Genesis is responsible for generating your error. You'll have to turn on WordPress debug to dive deeper into the problem.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 22, 2017 at 12:12 am #203624OC2PS
MemberI understand that the error is coming from the
embed-content
template in Theme Compat. Question is: How come the site using News Pro has to fallback on Theme Compat at all when the one using Metro Pro doesn't?March 22, 2017 at 5:56 am #203643Victor Font
ModeratorHow do you know Metro Pro isn't using embed-content.php? Did you run a trace or are you making an assumption because there is no error?
If you look at the source code of embed-content.php at line 33, you'll see:
if ( $data['width'] / $data['height'] > $aspect_ratio ) {
The $data array referred to in this line comes from:
wp_get_attachment_metadata( $thumbnail_id )
This means the content you are trying to embed is missing its height dimension. The height dimension is missing or set to 0, that's why you get a divide by zero error. This is all WordPress code. It has nothing to do with Genesis or the News Pro theme. You are passing bad data to the embed.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 22, 2017 at 4:24 pm #203685OC2PS
MemberYou are right - the error has nothing to do with the child theme - in the problematic site, I changed theme to Metro Pro, and still got the error.
Finding it hard to diagnose the issue - both sites have almost identical list of installed plugins and both are on the same server.
I tried turning wp_debug on, and above the embedded links, I got the error:
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Genesis_Tabs::init() should not be called statically in /public_html/wp-includes/class-wp-hook.php on line 298
Genesis Tabs - which is an integral part of the News Pro child theme look and feel, is installed only on the site that currently has the issue.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.