Activity Stream
48,167 MEMBERS
6805 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member

    Default 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('&laquo; Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    </div>
    <?php get_footer(); ?>
    some more code:

    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%; }
    I like this theme:

    Code: 
    http://www.mangoorange.com/resources/i2theme/
    Please help me to insert the code.

    Here the original article:
    Code: 
    http://www.transformationpowertools.com/wordpress/multi-column-wordpress-template
    Thanks everybody may help.
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    imdber.org justpaste.me
    index.php, archive.php, search.php,

  4.     
    #3
    Member
    Thanks for your experiences. Howerver I'm not a coder so any chances you could help me to edit these files?

  5.     
    #4
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    you can always use a theme that does it by default

  6.     
    #5
    Member
    Find a good theme and you will not have any problems, there are alot of that kind of themes.
    Link Building - Contact me for 20% discount
    Learn SEO - SEFlame.com

  7.     
    #6
    Member
    search for dione wordpress theme, possibly fit your needs

  8.     
    #7
    Member
    Quote Originally Posted by torrfriend View Post
    search for dione wordpress theme, possibly fit your needs
    Thanks! I tried that theme. It seem for video not for article.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 23rd Apr 2012, 03:54 PM
  2. Wordpress Article Fetch [Aka Wordpress leecher!]
    By S?nic in forum Webmaster Resources
    Replies: 2
    Last Post: 11th Apr 2012, 06:48 PM
  3. Replies: 0
    Last Post: 24th Jun 2011, 07:38 AM
  4. how to make vBulletin style XML?
    By Doublecrosser in forum Webmaster Discussion
    Replies: 11
    Last Post: 7th Nov 2010, 03:32 PM

Tags for this Thread

BE SOCIAL