• 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

Division by Zero Warning Error w/ Genesis Grid Loop Plugin

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 › Division by Zero Warning Error w/ Genesis Grid Loop Plugin

This topic is: not resolved

Tagged: genesis grid loop plugin, zero division

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 10 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 6, 2014 at 4:26 pm #130741
    suburbanite
    Member

    Hi all:
    I am using the Genesis Grid Loop Plugin (not to be confused with the Genesis Grid) and I getting the following error:

    Warning: Division by zero in /nfs/c03/h07/mnt/52073/domains/angie-webb.com/html/wp-content/plugins/genesis-grid-loop/plugin.php on line 262

    I understand that the cause of this is the code is trying to divide something by zero, but I don't really know PHP, so I don't know how to resolve it. Here's the block of code in question:

    /**
    	 * Fix Posts Nav
    	 *
    	 * The posts navigation uses the current posts-per-page to 
    	 * calculate how many pages there are. If your homepage
    	 * displays a different number than inner pages, there
    	 * will be more pages listed on the homepage. This fixes it.
    	 *
    	 */
    	function be_fix_posts_nav() {
    
    		global $wp_query;
    		$grid_args = $this->be_grid_loop_pagination();
    		if( ! $grid_args )
    			return;
    	
    		$max = ceil ( ( $wp_query->found_posts - $grid_args['features_on_front'] - $grid_args['teasers_on_front'] ) / ( $grid_args['features_inside'] + $grid_args['teasers_inside'] ) ) + 1;
    		$wp_query->max_num_pages = $max;
    		
    	}
    
    }
    
    new BE_Genesis_Grid; 

    Can anyone help?

    http://www.angie-webb.com
    January 9, 2015 at 8:18 am #136477
    Susan
    Moderator

    As you posted this a while back, I hope you were able to resolve your issue. If so, please mark this thread as "resolved", so it can be closed.

    If you are still needing assistance, please check back here, and I will attempt to escalate.

    Thanks!

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 2025 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