Well, I have tried
<?php echo get_the_title('About Us');?>
But the code is not working. I am using wordpress 4.1. This should work but it isn’t. Has wordpress updated the functions?
Well, I have tried
<?php echo get_the_title('About Us');?>
But the code is not working. I am using wordpress 4.1. This should work but it isn’t. Has wordpress updated the functions?
You must be logged in to post a comment.
Try this one, It’s may help you
Thanks 🙂
Try this one,may it’s help you
And if you want to get page or post title By id
Thanks
You are giving wrong parameters to
get_title
. See thecodex
.You should have used
ID
instead to get the title.So your code would be
NOTE: Parameters are optional.
You could use
the_title()
to display the title of the page. You can pass parameters for before and after HTML tags. For morr information, here are the docs:https://developer.wordpress.org/reference/functions/the_title/
You can try this
Reference