• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Error – Division by zero on Embed

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Error – Division by zero on Embed

This topic is: not resolved

Tagged: Division by Zero, Embed Content, error, Metro Pro, News Pro, Theme Compat

  • This topic has 5 replies, 2 voices, and was last updated 5 years, 12 months ago by OC2PS.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 19, 2017 at 4:29 am #203376
    OC2PS
    Member

    News 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:

    Arjhay, az elkötelezett arcfest?‘ – interjú

    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 #203377
    OC2PS
    Member

    P.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 #203464
    Victor Font
    Moderator

    Genesis 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 #203624
    OC2PS
    Member

    I 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 #203643
    Victor Font
    Moderator

    How 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 #203685
    OC2PS
    Member

    You 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.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble