【发布时间】:2011-10-03 19:12:53
【问题描述】:
我最近购买了一个 WordPress 主题,该主题可以展示精美的照片画廊,并且在主页上出现以下错误。
警告:第 36 行 /home/content/21/4913121/html/studios/wp-content/themes/dt-chocolate/front-gal.php 中除以零
警告:第 48 行 /home/content/21/4913121/html/studios/wp-content/themes/dt-chocolate/front-gal.php 中除以零
以下是第 50 行的代码 - 带有/**/ 的行是麻烦的行。任何帮助表示赞赏!
<?php
global $postgallery;
$show = $postgallery->get_post_option('show');
$arr = $postgallery->get_post_option('show_'.$show);
$arr = explode(",", $arr);
$arr = (array)$arr;
//$myterms = get_terms('dt_gallery_cat');
$myterms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy'=> 'dt_gallery_cat'));
$images = array();
global $term, $h;
foreach ($myterms as $term)
{
if ($show == "all")
{
}
elseif ($show == "only")
{
if ( !in_array( $term->term_id, $arr ) )
continue;
}
elseif ($show == "except")
{
if ( in_array( $term->term_id, $arr ) )
continue;
}
$term->pic = wp_get_attachment_image_src( $term->image_id, 'full' );
$k = $term->pic[1] / $term->pic[2];
/**/$term->pic = $term->pic[0];/**/
$size = taxonomy_get_size( $term->term_id );
if ($size == "s")
$w = 220;
if ($size == "m")
$w = 460;
if ($size == "l")
$w = 700;
/**/$h = ceil($w / $k);/**/
$term->pic = get_template_directory_uri().'/thumb.php?src='.$term->pic.'&w='.$w.'&h='.$h.'&zc=1';
【问题讨论】:
-
要求退款。 Wordpress 主题要花钱?!
-
将
$w预设为“默认”预期大小,因为如果未设置$size,则未设置$w,这会导致部分问题。 -
Themeforest 主题很吓人:“将 CHMOD 777 设置为文件夹“your_site/wp-content/themes/dt-chocolate/cache” 2) 必须创建文件夹“your_site/wp-content/uploads”并且CHMOD 设置为 777" 是的,对。你好,黑客,请黑我。
-
我自己不是 Themeforest 的粉丝,但我丈夫喜欢他们的设计。它们确实有一些图形精美的主题,但绝对缺乏说明、功能和安全性。