Frequently used wordpress tags
Description
This is a list of frequently used wordpress tags to use in single.php pages and inside the loop of a wordpress query
This is a list of frequently used wordpress tags to use in single.php pages and inside the loop of a wordpress query
PHP Source Code
<?php the_title();?>
<?php the_content();?>
<?php the_permalink(); ?>
This will show the authors username
<?php the_author(); ?>
This will show the author's first and last name
<?php the_author_meta( 'first_name'); ?>
<?php the_author_meta( 'last_name'); ?>
<?php echo get_the_date( 'm-d-Y' ); ?>
<a href="<?php echo wp_logout_url(); ?>">Logout</a>
This will log them out and redirect to homepage
<a href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a>
Featured image URL
<?php the_post_thumbnail_url(); ?>
The ID of a post
<?php the_ID(); ?>
Home URL
<a href="<?php echo get_home_url(); ?>">Home</a>
Horizontal comma separated list of categories
<?php the_category(', '); ?>
Vertical list of categories as list items
<?php the_category();?>
Wordpress code for the current category title inside the loop
<?php single_cat_title(); ?>
Get the menu by id
<?php echo esc_url( get_permalink(88) ); ?>