WordPress – Template Calls

WordPress - General Theme Development PHP

Snippet Overview

WordPress – Template Calls

The following are standard WordPress PHP template calls that can be used for custom theme development. These are intended for use within the loop.

Display the Page Title / Header

<?php the_title(); ?>   

Outputs the permalink to the Post or Custom Post Type specified in the string.

<?php echo esc_url( get_permalink() ); ?>

To combine the link a Post title with the permalink you could use something like this:

<a class="post-title" href="<?php echo esc_url( get_permalink() ); ?>" ><h2><?php the_title(); ?></h2></a> 

Display the Excerpt

<?php the_excerpt(); ?>

Display the post content

<?php the_content(); ?>

Display the post thumbnail

<?php the_post_thumbnail(); ?>
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply