我使用与此网站http://foreignpolicydesign.com/v3/相同的主题。但是,我的测试站点不会在列
中分发博客条目可能导致此问题的原因是什么?我怀疑它是什么设置$ col_class设置x1~xN,但我找不到这个变量的来源。
以下是代码:
<?php include (TEMPLATEPATH . '/tanzaheader.php');
// [grid column setting]
$col_w = 200; // width of grid column
$gap_w = 35; // padding + margin-right (15+15+5)
$max_col = 5; // max column size (style div.x1 ~ xN)
// * additional info *
// check also "style.css" and "header.php" if you change $col_w and $gap_w.
// - style.css:
// div.x1 ~ xN
// div.grid-item
// div.single-item
// ... and maybe #sidebar2 li.widget.
// - header.php:
// gridDefWidth in javascript code.
//
// if you want to show small images in main page always, set $max_col = 1.
// [grid image link setting]
$flg_img_forcelink = true; // add/overwrite a link which links to a single post (permalink).
$flg_img_extract = false; // in single post page, extract thumbnail link to an original image.
$flg_obj_fit = 'large-fit'; // none | small-fit | large-fit ... how to fit size of object tag.
// * additional info *
// if you use image popup utility (like Lightbox) on main index, set $flg_img_forcelink = false;
?>
<!-- <?php if (is_singular()) : $is_top_single = true; /* wide column for single post */ ?> -->
<?php /* make a new query for grid items (in single page) */
$new_query_arg = 'paged='.$paged;
// use this code if you want filter items by category.
$arr_catID = array(20);
foreach( get_the_category() as $cat) $arr_catID[] = $cat->cat_ID;
if ( count($arr_catID) ) $new_query_arg .= '&cat=' . join(',', $arr_catID);
query_posts($new_query_arg);
?>
<!-- <?php endif; /* end of if is_singular() */ ?> -->
<div id="grid-wrapper">
<?php if (have_posts()) :
if ( $is_top_single ) $GLOBALS['more'] = false; //important
while (have_posts()) : the_post(); ?>
<?php
$content = get_the_content('Details »');
$content = apply_filters('the_content', $content);
list($col_class, $grid_img) = adjust_grid_image(
$content,
$col_w,
$gap_w,
$max_col,
$flg_img_forcelink,
$flg_obj_fit
);
?>
<div <?php post_class('grid-item ' . $col_class); ?> id="post-<?php the_ID(); ?>">
<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php if ($grid_img) echo '<div class="grid-image">' . $grid_img . '</div>'; ?>
<div class="post-body">
<?php
$content = preg_replace('/<img(?:[^>]+?)>/', '', $content); // remove img tags
$content = preg_replace('/<a([^>]+?)><\/a>/', '', $content); // remove empty a tags
$content = preg_replace('/<p([^>]*?)><\/p>/', '', $content); // remove empty p tags
$content = preg_replace('/<object(.+?)<\/object>/', '', $content); // remove object tags
echo $content;
?>
</div>
<p class="post-meta">
Published on <?php the_time( get_option('date_format') ); ?> <?php the_time(); ?>.<br />
Filed under: <?php the_category(', ') ?> <?php the_tags('Tags: ', ', '); ?>
<?php edit_post_link(__("Edit This"), '(', ')'); ?><br />
<?php /*comments_popup_link();*/ ?>
</p>
</div>
<?php endwhile; else : ?>
<div class="grid-item x1">
<h2>Not Found</h2>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
</div>
<?php endif; ?>
</div><!-- /grid-wrapper -->
<div class="pagination" id="grid-pagination">
<?php paginate_links2($is_top_single); ?>
</div>
<?php /* reset the query */
wp_reset_query();
?>
</div><!-- /container -->
<?php include (TEMPLATEPATH . '/tanzafooter.php'); ?>
答案 0 :(得分:0)
这些列不是由PHP代码创建的,它们是由jQuery插件动态创建的。
您的主题在此处引用:
http://wpbeta.nfshost.com/wp-content/themes/js/jquery.vgrid.0.1.4-mod.js
但是返回404文件未找到错误。