dongmangji0950 2014-06-20 18:28
浏览 20

按错误划分Genesis Grids插件

I am getting this error on this page: http://3a8.c8c.myftpupload.com/category/portfolio/

This is the error: Warning: Division by zero in /home/content/p3nexnas05_data01/98/2124598/html/wp-content/plugins/genesis-grid-loop/plugin.php on line 251

The page is displaying the way I want it to, but the warning is appearing at the bottom of the page.

Line 251 of the plugin mentioned in the warning looks like this:

$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;

I have the theme set to display 12 posts. I am using the Genesis Studiopress Modern Portfolio Pro child theme.

Can anyone help me? I have put in a support note with the plugin developer here: http://wordpress.org/support/plugin/genesis-grid-loop But haven't heard anything yet. Appreciate your help! Thanks!

  • 写回答

1条回答 默认 最新

  • dou12754 2014-06-20 18:53
    关注

    The warning message just says ( $grid_args['features_inside'] + $grid_args['teasers_inside'] ) part of your code is returning as a zero in value

    so ANYTHING / 0 will cause an issue is what wordpress is warning you about.

    as a fix to this if you do not want to touch the code then try changing teasers_inside or features_inside post amounts (whatever that means in your backend) and increase it

    if you want to touch the code portion

    add this code in the wp-settings.php file to disable wordpress warning message outputs

    //Add define('WP_DEBUG',true);
    if (defined('WP_DEBUG') and WP_DEBUG == true){
         error_reporting(E_ALL);
    } else {
         error_reporting(0);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题