javascript - How to edit php file and return wordpress blog entries in multiple columns? -
i using same theme site http://foreignpolicydesign.com/v3/. however, test site not distribute blog entries in columns
what might causing problem? suspecting whatever sets $col_class set x1 ~ xn, cannot find source of variable.
here code:
<?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 "style.css" , "header.php" if change $col_w , $gap_w. // - style.css: // div.x1 ~ xn // div.grid-item // div.single-item // ... , maybe #sidebar2 li.widget. // - header.php: // griddefwidth in javascript code. // // if want show small images in main page always, set $max_col = 1. // [grid image link setting] $flg_img_forcelink = true; // add/overwrite link links single post (permalink). $flg_img_extract = false; // in single post page, extract thumbnail link original image. $flg_obj_fit = 'large-fit'; // none | small-fit | large-fit ... how fit size of object tag. // * additional info * // if use image popup utility (like lightbox) on main index, set $flg_img_forcelink = false; ?> <!-- <?php if (is_singular()) : $is_top_single = true; /* wide column single post */ ?> --> <?php /* make new query grid items (in single page) */ $new_query_arg = 'paged='.$paged; // use code if want filter items category. $arr_catid = array(20); foreach( get_the_category() $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 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 criteria.'); ?></p> </div> <?php endif; ?> </div><!-- /grid-wrapper --> <div class="pagination" id="grid-pagination"> <?php paginate_links2($is_top_single); ?> </div> <?php /* reset query */ wp_reset_query(); ?> </div><!-- /container --> <?php include (templatepath . '/tanzafooter.php'); ?>
the columns not created php code, created dynamically jquery plugin.
your theme referencing here:
http://wpbeta.nfshost.com/wp-content/themes/js/jquery.vgrid.0.1.4-mod.js
but returns 404 file not found error.
Comments
Post a Comment