Last active
May 17, 2018 11:38
-
-
Save rubel306/cbbc10dad597de0afdea80188a9a3e47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment