Last active
December 4, 2017 09:58
-
-
Save humayunahmed8/10e2c4bdc3d75f337b8b8204dab6625b to your computer and use it in GitHub Desktop.
Querying by Post Type
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
<!-- Querying by Post Type --> | |
<section id="slider"> | |
<?php | |
query_posts(array( | |
'post_type' => 'slider', | |
'post_per_page' => 1, | |
)); | |
if(have_posts()) : while(have_posts()) : the_post(); ?> | |
<div class="slider-container text-center"> | |
<div class="overlay"> | |
<div class="container"> | |
<div class="slider-txt"> | |
<h2 class="title"><?php the_title(); ?></h2> | |
<p class="slider-description"><?php the_content(); ?></p> | |
<div class="link"> | |
<a href="#" class="btn custom-btn">View Portfolio</a> | |
</div> | |
</div><!-- /.slider-txt --> | |
</div><!-- /.container --> | |
</div><!-- /.overlay --> | |
</div><!-- /.slider-container --> | |
<?php endwhile; endif; | |
?> | |
</section><!-- /#slider --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment