Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// Display post title using post ID
echo get_the_title( 5 );
// Display post title and safely escape value
echo esc_html( get_the_title() );
// Using the_title function to automatically echo the title, while you can append or prepend the title using the function as displayed below
the_title( 'Before:', ' - After' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment