Advertisement
alaminlink

WP Theme Development (Blog Page Query)

Sep 9th, 2014
3,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. Post Query in index.php/*Wordpress post qury*/
  3. <?php if(have_posts()) : ?>
  4. <?php while (have_posts()) : the_post(); ?>
  5. <!-- Your Post Query here -->
  6. <?php endwhile; ?>
  7. <?php endif; ?>
  8. /* Your Post Query code. You can take any div for customization */
  9. <?php the_title(); ?> = This code for post title
  10. <?php the_permalink(); ?> = This code for post permalink
  11. <?php the_time('M d, Y') ?> = This code for post time
  12. <?php the_excerpt(); ?> = This code for post summary or some content
  13. <?php the_content(); ?> = This code for post whole content
  14. <?php the_category(', '); ?> = This code for post category
  15. <?php comments_popup_link('No Comment', '1 Comment', '% Comments'); ?> = This code for post comment.
  16. /*This code for pagination. You can taking this code below post query and also here some class for style*/
  17. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older
  18. posts') ); ?></div><div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span
  19. class="meta-nav">&rarr;</span>') ); ?></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement