Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="front-pg-container-left">
- <?php
- global $post;
- $args = array( 'numberposts' => 2, 'category' => 0 );
- $myposts = get_posts( $args );
- foreach( $myposts as $post ) : setup_postdata($post);
- $image = wp_get_attachment_image_src( get_post_thumbnail_id() );
- $image_url = $image[0];
- ?>
- <div class="front-page-second" style="background-image: url('<?php echo esc_url( $image_url ); ?>');">
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- </div>
- <?php endforeach; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement