Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function post_shortcode($atts, $content= null ){
- extract(shortcode_atts(array(
- 'post_type' => "post",
- 'post_per_page' => 10
- ), $atts));
- $get_post = new WP_Query(array(
- 'post_type' => 'page',
- 'post_per_page' => 5
- )); ?>
- <div class="content-wrap" style="background-color:#2E3539; padding: 80px 0; color: #ddd;">
- <div class="container">
- <div class="row">
- <?php while($get_post->have_posts()): $get_post->the_post(); ?>
- <div class="col-lg-6">
- <div class="post-content" style="padding:80px 0px;">
- <h2><?php the_title(); ?></h2>
- <p><?php the_content(); ?></p>
- </div>
- </div>
- <?php endwhile; ?>
- </div>
- </div>
- </div>
- <?php
- }
- add_shortcode('post_content', 'post_shortcode');
- ?>
Add Comment
Please, Sign In to add comment