Echo Post Title and Link in PHP

<?php
	$postID = $wp_query->post->ID;
	$permalink = get_permalink( $postID );
	$postInfo = get_post($postID);
	$postTitle = $postInfo->post_title;

	echo "<li><a href="$permalink">$postTitle</a></li>";
?>

Revisions

There are no revisions for this post.

No comments yet.

Leave a Reply