• dingledoink

    (@dingledoink)


    Hi there!

    I’ve tried to implement a few different methods to accomplish the following to no avail, and I believe it may be due to the theme I’m using. None of the solutions I’ve found have been specific to that theme, namely “Berlin theme from Graph Paper Press”

    I’d like to have a specific Category (in this case the ‘products’ Page seen here http://www.kinetikcycles.com/category/products/ ) display as a grid of posts (3 columns wide) rather then the normal “list” as seen on the rest of the site, less the main/home page.

    This is the code I’ve tried, put in a category-products.php file.

    <?php
    $counter = 1; //start counter
    
    $grids = 3; //Grids per row
    
    global $query_string; //Need this to make pagination work
    
    /*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
    query_posts($query_string . '&caller_get_posts=1&posts_per_page=12');
    
    if(have_posts()) :	while(have_posts()) :  the_post();
    ?>
    <?php
    //Show the left hand side column
    if($counter == 1 || $counter == 2) :
    ?>
    			<div class="griditemleft">
    				<div class="postimage">
    					<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    				</div>
                    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    			</div>
    <?php
    //Show the right hand side column
    elseif($counter == $grids) :
    ?>
    <div class="griditemright">
    				<div class="postimage">
    					<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    				</div>
                    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    			</div>
    <div class="clear"></div>
    <?php
    $counter = 0;
    endif;
    ?>
    <?php
    $counter++;
    endwhile;
    //Pagination can go here if you want it.
    endif;
    ?>

    I’ve also then included the following at the bottom of the style.css file, perhaps the wrong location?

    #gridcontainer{margin: 20px 0; width: 100%; }
    #gridcontainer h2 a{color: #77787a; font-size: 13px;}
    #gridcontainer .griditemleft{float: left; width: 278px; margin: 0 40px 40px 0;}
    #gridcontainer .griditemright{float: left; width: 278px;}
    #gridcontainer .postimage{margin: 0 0 10px 0;}

    Any help would be greatly appreciated.

    Cheers,

    Dan

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    (@esmi)

    I’m sorry but as you are using a commercial theme, you need to seek support from the theme’s developer/vendor. We do not support commercial products here.
    Try http://graphpaperpress.com/support/

    Thread Starter dingledoink

    (@dingledoink)

    Oh… found this, assumed otherwise.

    Thanks!

    DW

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Remember to read the forum guidelines beforehand.

    Thread Starter dingledoink

    (@dingledoink)

    Like I said, found the above, and assumed that I could get some help here.

    Thanks anyway, no need to comment the same thing again, and again… I get it.

    Kind regards,

    Dan

    Michael

    (@alchymyth)

    independant from the used theme:

    you are not using a div with the css id of #gridcontainer in your code, where all the styles are based on;

    using the reduced styles like so should give you a start:

    .griditemleft{float: left; width: 278px; margin: 0 30px 40px 0;}
    .griditemright{float: left; width: 278px;}
    .postimage{margin: 0 0 10px 0;}
    Thread Starter dingledoink

    (@dingledoink)

    NAILED IT! Thanks so much @alchymyth for your help.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Berlin theme from Graph Paper Press – Grid Posts’ is closed to new replies.