Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $items = new WP_Query(array(
- 'post_type' => 'portfolio',
- 'posts_per_page' => -1
- ));
- while ( $items->have_posts() ) :
- $items->the_post();
- $categories = get_the_category($post->ID);
- ?>
- <?php
- $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' );
- ?>
- <?php
- if ( in_category( 'print' )) { ?>
- <a href="#port-<? the_ID(); ?>" data-toggle="modal">
- <div class="span2" id="square" style="background: url(<?php echo $src[0]; ?>); background-size:100%; background-repeat:no-repeat; background-position:center;">
- <span>
- <h3>
- <?php the_title();?>
- </h3>
- </span>
- </div>
- </a>
- <?php } else { ?>
- <div class="span2" id="square" style="background:#000;">
- <span>
- <h3>
- <?php the_title();?>
- </h3>
- </span>
- </div>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement