Basic Wordpress Loop


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php get_header(); ?>
  2.  
  3. <?php if(have_posts()) : ?>
  4. <?php while (have_posts()) : the_post(); ?>
  5.  
  6. <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  7.  
  8. <?php the_content(''); ?>
  9. <h4>Posted in <?php the_category(', ') ?></h4>
  10. <?php endwhile; ?>
  11. <?php endif; ?>
  12.  
  13.  
  14.  
  15. <?php get_footer(); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.