Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Grid Layout - Wordpress category WordPress

  • REFUNDED

Hi Guys,

I have an amped child theme installed running on the genesis frame work. I would like to have a grid layout for certain catagories and a normal list layout for other categories. So for example if you click on one catagory it will display all the posts in a grid format, with around 2 posts going across .. I would like it to display the featured image and post title only.

I would like this for about 3 categories. I am very basic with wordpress and have been forwarded to the following links:

http://codex.wordpress.org/Category_Templates
http://dev.studiopress.com/genesis-grid-loop.htm

I have also been given this information:

<blockquote> This should get you going on the right path though. You need to remove the default loop, then write a function that conditionally loads your new loop. Something like this (in functions.php):

remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'child_custom_loop');
function child_custom_loop() {

if(is_category('category-1') || is_category('category-2') || is_category('category-3')):
[your grid loop code goes here]
else:
genesis_do_loop();
endif;

}


This code is untested and incomplete (you need to build the grid loop). </blockquote>

But honestly do not know where to start. I would need to very clear and basic instructions or even pay someone for their time to do it!

Any help would be appreciated. Thanks

Answers (3)

2011-05-30

Baki Goxhaj answers:

The directions you are given are very clear. To complete this, I need to work on site, as I need code from the theme to build the new loop. But $15 is little for this task; $50 would be fair.


Pal S comments:

Is it possible to code it so I can choose which layout I would like for each category?

2011-05-30

Just Me answers:

The "not too much coding" route would be to create a category template file for your three categories (this means three templates files). Then edit the files to your needs.

If your category's slugs are "book","movie","play" for instance. You could create (just copy category.php and rename) category-book.php, category-movie.php and category-play.php.

When you edit one of them it will only reflect in the display of that specific category.



Pal S comments:

Would you be able to guide me through this exactly?


Just Me comments:

What did you try so far? How much PHP, WordPress, HTML, CSS knowledge do you have?


Pal S comments:

Not much at all to be honest and havent tried anything as I dont know where to start! If you want dont mind explaining, i can pay a little extra? I have gone into the wp-includes folder, copied the category.php file and pasted 2 for the different categories I would like...

So far its:
category-artists.php
category-management.php

The layouts are going to be the same for the artists and management category.


Just Me comments:

It is not about the money. Right now I don't have time to teach PHP.
If you change a little thing in one or both of the template files you mention, does it work? Do you see a difference? Just edit a word/phrase.

2011-05-30

Ryan Riatno answers:

create category-artists.php and category-management.php
in your child themes directory and fill with this

<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'pretty_grid_loop_helper' );
/** Add support for Genesis Grid Loop **/
function pretty_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 2,
'feature_image_size' => 0,
'feature_image_class' => 'alignleft post-image',
'feature_content_limit' => 0,
'grid_image_size' => 'grid-thumbnail',
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 0,
'more' => __( '[Continue reading...]', 'genesis' ),
'posts_per_page' => 6,
) );
} else {
genesis_standard_loop();
}
}

/** Remove the post meta function for front page only **/
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );

genesis();
?>


Pal S comments:

Hi Ryan,

I have placed category-artists.php with the above code in to:

website/wp-content/themes/genesis
website/wp-content/themes/amped

But when i visit the category it displays the last 6 posts i have published, some which are in completely different categories.

Thanks