Basic WordPress Snippets

Fundamental 49 views
0
0 Flares 0 Flares ×

Posts the image uploaded to the “Featured Image” box on an individual post:

<?php the_post_thumbnail(); ?>

Places the link of the page or post in the loop:

<?php the_permalink(); ?>

Places the Title of the page or post in the loop:

<?php the_title(); ?>

Places the Excerpt of the page or post in the loop:

<?php the_excerpt(); ?>

Places the Content of the page or post in the loop:

<?php the_content(); ?>

This is the basic WordPress loop that queries all posts:

<?php if (have_posts()) : ?>
   <?php while (have_posts()) : the_post(); ?>    
   <!-- do stuff ... -->
   <?php endwhile; ?>
<?php endif; ?>
Posted in Wordpress

Discuss:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

No Trackbacks.

Login

Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×