Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create two column layout
- function [site_name]_archive_post_class( $classes ) {
- global $wp_query;
- if( ! $wp_query->is_main_query() )
- return $classes;
- $classes[] = 'forty-five';
- if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 )
- $classes[] = 'first';
- return $classes;
- }
- add_filter( 'post_class', '[site_name]_archive_post_class' );
- //CSS
- .forty-five {
- float: left;
- width: 45%;
- @media (max-width: 480px) {
- width: 100%;
- }
- &.first {
- margin-right: 10%;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement