Results 1 to 7 of 7
-
14th Oct 2011, 03:02 AM #1OPMember
How to make Wordpress listing article in grid style?
I going to set up a wordpress blog. However I like listing my stuff like this:
I found this TUT however I don't know where to insert
Code:<?php get_header(); ?> <?php // code to display a number of posts in multi columns top-to-bottom left-to-right ?> <?php global $query_string; ?> <?php $set_number_of_columns = 2; // enter numbers of columns here; $set_number_of_rows = 4; // enter numbers of rows here $set_showpost = $set_number_of_columns * $set_number_of_rows ; //setup query with parameter for paged $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string.'&showposts='.$set_showpost.'&paged='.$paged); // get number of posts for this, $num_of_posts = $wp_query->post_count; // make adjustment for paged to get three equaly long columns even on last paged page // divide by $set_number_of_columns to get number per column, // round up to next integer to make $ppc posts per column variable, or $set_number_of_rows whatever is smaller $ppc = min(ceil($num_of_posts/$set_number_of_columns),$set_number_of_rows); // calculates number of rows, i.e. showposts for the following query_posts and get_posts ?> <?php for ( $col = 1; $col <= $set_number_of_columns; $col += 1) { ?> <div class="col<?php echo $col;?>"> <?php $row = 1; $noffset = ($col -1) * $ppc + ($paged - 1) * $set_showpost ; //calculate offset parameter if paged $posts = get_posts($query_string.'&numberposts='.$ppc.'&offset='.$noffset); foreach ($posts as $post) : start_wp(); ?> <div id="post-<?php the_ID(); ?>" class="post row-<?php echo ($row%2); ?>"> <!-- start of anything to do with post --> <h2> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="storycontent"> <?php the_excerpt(__('(more...)')); ?> </div> <!-- end of anything to do with post --> </div> <!-- end #post --> <?php $row++; endforeach; ?> </div> <?php } ?> <?php // close the for-loop // ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> <?php get_footer(); ?>
the naming of the css classes is:
class .col1 for the first column; class .col2 for the second column; and so forth.
same thing for the rows: class .row1 for the posts in first row, on so on.
going with this code is the css:
Code:1 .col1, .col2 {float:left; width:49%; }
Code:http://www.mangoorange.com/resources/i2theme/
Here the original article:
Code:http://www.transformationpowertools.com/wordpress/multi-column-wordpress-template
tcnnvnn Reviewed by tcnnvnn on . How to make Wordpress listing article in grid style? I going to set up a wordpress blog. However I like listing my stuff like this: http://www.transformationpowertools.com/wordpress/wp-content/uploads/2010/01/grid-style-template-512x375.jpg I found this TUT however I don't know where to insert <?php get_header(); ?> <?php // code to display a number of posts in multi columns top-to-bottom left-to-right Rating: 5
-
14th Oct 2011, 10:33 AM #2MemberWebsite's:
imdber.org justpaste.meindex.php, archive.php, search.php,
-
16th Oct 2011, 01:23 AM #3OPMember
Thanks for your experiences. Howerver I'm not a coder so any chances you could help me to edit these files?
-
16th Oct 2011, 01:52 AM #4OH GOD!!!!!Website's:
HotNewHipHop.comyou can always use a theme that does it by default
-
16th Oct 2011, 10:01 AM #5Member
Find a good theme and you will not have any problems, there are alot of that kind of themes.
-
16th Oct 2011, 11:02 PM #6Member
search for dione wordpress theme, possibly fit your needs
Skipp the Adfly Adfocus LinksBucks by one click(No Ads, No pop up's)
For << Kimsufi >> Truly Unmetered - No more 5Tb or 10Tb Limit
Wordpress Theme not working after editing footer copyright
-
17th Oct 2011, 02:35 AM #7OPMember
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] Article Submission-Spin And Submit Article To Over 1200 Article Directories
By alexjer12 in forum ServicesReplies: 2Last Post: 23rd Apr 2012, 03:54 PM -
Wordpress Article Fetch [Aka Wordpress leecher!]
By S?nic in forum Webmaster ResourcesReplies: 2Last Post: 11th Apr 2012, 06:48 PM -
any body knows how to make style full width in vb 3.8.x
By chems in forum vBulletinReplies: 0Last Post: 24th Jun 2011, 07:38 AM -
how to make vBulletin style XML?
By Doublecrosser in forum Webmaster DiscussionReplies: 11Last Post: 7th Nov 2010, 03:32 PM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...