Category Archives Style?

January 2013 WordPress Theme
GK User
Wed Jun 19, 2013 8:35 am
How to change category archives style how news articles will be listed on the archive page like on attached screenshot?

I also looking to find way to enlarge number of published articles (under category archives) from current 3 article on minimum 5?
User avatar
Fresh Boarder

GK User
Thu Jun 20, 2013 10:50 am
It's a lot of custom work with this look, so I only write how to start.

To achieve 5 articles on cateogry page add e.g. this function to /News/gavern/user.functions.php file:
Code: Select all
function five_posts_on_category( $query ) {
    if ( $query->is_category() && $query->is_main_query() ) {
        $query->set( 'posts_per_page', '5' );
    }
}
add_action( 'pre_get_posts', 'five_posts_on_category' );


About attached looks start with enabling override.css file in Template Options -> Advanced, then paste this code to override.css file:
Code: Select all
.category article figure.featured-image img {
   float: left;
   width: 30%;
}

.category #gk-mainbody article > header {
   width: 67%;
   float: right;
}

.category article > .summary {
   float: right;
}

.category #gk-mainbody article > header h2 {
   font-size: 20px;
}


then you have to customize this code, or maybe try to use GK NSP widget except category.
User avatar
Moderator

GK User
Thu Jun 20, 2013 1:14 pm
Thank you! All work perfectly now with changes which you mentioned and GK NSP!
User avatar
Fresh Boarder


cron